Factorial Divisible by Prime Power

Theorem
Let $n \in \Z: n \ge 1$.

Let $p$ be a prime number.

Let $n$ be expressed in base $p$ notation:
 * $\ds n = \sum_{j \mathop = 0}^m r_j p^j$

where $0 \le r_j < p$.

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

Let $p^\mu$ be the largest power of $p$ which divides $n!$, that is:
 * $p^\mu \divides n!$
 * $p^{\mu + 1} \nmid n!$

Then:
 * $\mu = \dfrac {n - \map {s_p} n} {p - 1}$

where $\map {s_p} n$ is the digit sum of $n$.

Proof
If $p > n$, then $\map {s_p} n = n$ and we have that:
 * $\dfrac {n - \map {s_p} n} {p - 1} = 0$

which ties in with the fact that $\floor {\dfrac n p} = 0$.

Hence the result holds for $p > n$.

So, let $p \le n$.

From De Polignac's Formula, we have that:

where $p^s < n < p^{s + 1}$.

From Quotient and Remainder to Number Base: General Result:
 * $\ds \floor {\frac n {p^k} } = \sqbrk {r_m r_{m - 1} \ldots r_{k + 1} r_k}_p = \sum_{j \mathop = 0}^{m - k} r_j p^j$

where $0 \le r_j < p$.

Hence:

Hence the result.