Prime Factorization of Factorials

Theorem
Let $n \in \N_{\ge 1}$.

Let $n! = p_1^{b_1}p_2^{b_2}p_3^{b_3} \ldots p_m^{b_m}$ be the prime factorization of $n$ factorial.

Then for any $p_i$ occurring in the prime factorization of $n!$,


 * $\displaystyle b_i = \left \lfloor {\frac n p_i} \right \rfloor + \left \lfloor {\frac n { {p_i}^2} } \right \rfloor + \left \lfloor {\frac n {{p_i}^3} } \right \rfloor + \cdots + \left \lfloor {\frac n {{p_i}^k} } \right \rfloor $

where the sum is over all powers of $p_i$ until ${p_i}^k > n$.

Here $\left \lfloor {\cdot} \right \rfloor$ denotes the Floor Function.