Problem 582: (1992 AIME, 15)
Define a positive integer $n$ to be a factorial tail if there is some positive integer $m$ such that the decimal representation of $m!$ ends with exactly $n$ zeroes. How many positive integers less than $1992$ are not factorial tails?
- The number of trailing zeros of $m!$ is $z(m)=\sum_{i\ge1}\bigl\lfloor\frac m{5^i}\bigr\rfloor$. It is constant on each block $5j,\dots,5j+4$ and strictly increases from one block to the next.
- So the positive factorial tails are exactly the values $z(5j)$, $j=1,2,\dots$, all different.
- $z(7975)=1595+319+63+12+2=1991$ and $z(7980)=1992$. So the tails below $1992$ are $z(5j)$ for $j=1,\dots,1595$, giving $1595$ numbers.
- The others: $1991-1595=396$. The answer is $\boxed{396}$.
Define a positive integer $n$ to be a factorial tail if there is some positive integer $m$ such that the decimal representation of $m!$ ends with exactly $n$ zeroes. How many positive integers less than $2500$ are not factorial tails?