structural:scholar_edition
Factors of factorials

Let n be a positive integer and p a positive prime number. The exponent of the highest power of p that divides n ! is given by a version of Legendre's formula

where n = ∑ k a k p k {\textstyle n=\sum _{k}a_{k}p^{k}} is the way of writing n in base p. This is a finite sum, since the floors are zero when p > n.