De Polignac's Formula

Theorem
Let $n!$ be the factorial of $n$.

Let $p$ be a prime number.

Then $p^\mu$ is a divisor of $n!$, and $p^{\mu + 1}$ is not, where:
 * $\displaystyle \mu = \sum_{k \mathop > 0} \floor{\frac n {p^k} }$

where $\left \lfloor{\cdot}\right \rfloor$ denotes the floor function.

Proof
Note that although the summation given in the statement of the theorem is given as an infinite sum, in fact it terminates after a finite number of terms (because when $p^k > n$ we have $0 < n/p^k < 1$).

From Number of Multiples less than Given Number, we have that $\floor{\dfrac n {p^k} }$ is the number of integers $m$ such that $0 < m \le n$ which are multiples of $p^k$.

We look more closely at $n!$:
 * $n! = 1 \times 2 \times \ldots \times \paren {n - 1} \times n$

We see that any integer $m$ such that $0 < m \le n$ which is divisible by $p^j$ and not $p^{j + 1}$ must be counted exactly $j$ times.

That is:
 * once in $\floor {\dfrac n p}$
 * once in $\floor {\dfrac n {p^2} }$

$\ldots$
 * once in $\floor {\dfrac n {p^j} }$

And that is all the occurrences of $p$ as a factor of $n!$.

Thus:
 * $\mu = \floor {\dfrac n p} + \floor {\dfrac n {p^2} } + \dotsb + \floor {\dfrac n {p^j} }$

Hence the result.

Also known as
De Polignac's Formula is also known as Legendre's Formula for.