Legendre's Formula
Legendre's formula gives the exponent of a prime in the factorisation of . It is used, for example, to count the trailing zeros of a factorial, which equal the exponent of .
LaTeX
v_p(n!)=\sum_{i\ge1}\left\lfloor\frac{n}{p^i}\right\rfloorVariables
- exponent of p in n!
- prime
- floor (round down)
Example
How many trailing zeros does have?
- .
Answer: trailing zeros.