[Math] How much zeros has the number $1000!$ at the end

arithmeticelementary-number-theory

I know that it depends of the factors of five and two.

But the number is too long to figure how much factos of five and two there are.

Any hints?

Best Answer

There are always twos a-plenty. The exponent of prime $p$ occuring in $n!$ is well-known to be $$ \lfloor n/p\rfloor +\lfloor n/p^2\rfloor + \lfloor n/p^3\rfloor +\ldots$$ hence for $n=1000$ and $p=5$ we find $$ \lfloor 1000/5\rfloor +\lfloor 1000/25\rfloor + \lfloor 1000/125\rfloor +\lfloor 1000/625\rfloor + \ldots= 200+40+8+1+0+\ldots=249$$ (Just to check, for $p=2$ we get $$500+250+125+62+31+15+7+3+1\gg249 $$ so really more than enough)