De Polignac's Formula/Technique

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

Let $p$ be a prime number.

Let $\mu$ be defined as:
 * $\displaystyle \mu = \sum_{k \mathop > 0} \left \lfloor{\frac n {p^k}}\right \rfloor$

When calculating $\mu$, the easiest way to calculate the next term is simply to divide the previous term by $p$ and discard the remainder:


 * $\left \lfloor{\dfrac n {p^{k + 1} } }\right \rfloor = \left \lfloor{\left \lfloor{\dfrac n {p^k} }\right \rfloor / p }\right \rfloor$

Proof
From Floor of $\dfrac {x + m} n$:
 * $\left\lfloor{\dfrac {x + m} n}\right\rfloor = \left\lfloor{\dfrac {\left\lfloor{x}\right\rfloor + m} n}\right\rfloor$

which is valid for all integers $m, n$ such that $n > 0$.

In this instance, $m = 0$ and $n = p$, while $x = \dfrac n {p^k}$.