(Primes in factorials, Legendre)The exponent of the prime $p$ in $n!$ is\[\left\lfloor\frac np\right\rfloor+\left\lfloor\frac n{p^2}\right\rfloor+\left\lfloor\frac n{p^3}\right\rfloor+\cdots .\]In particular, the number of zeros at the end of $n!$ is $\lfloor n/5\rfloor+\lfloor n/25\rfloor+\lfloor n/125\rfloor+\cdots$.
← Back to Problem 938