Skip to main content

1992 AIME Problem 15

Problem 15 of 15HarderNumber TheoryCombinatoricsArithmetic

Define a positive integer nn to be a factorial tail if there is some positive integer mm such that the decimal representation of m!m! ends with exactly nn zeroes. How many positive integers less than 19921992 are not factorial tails?

Your answer

Integer from 0 to 999
Show solution

Solution

The number of trailing zeroes is f(m)=∑j≥1⌊m5j⌋.f(m)=\sum_{j\geq1}\lfloor \frac{m}{5^j}\rfloor. Its positive distinct values occur at the multiples 5k,5k, and f(5k)=k+f(k)f(5k)=k+f(k) is strictly increasing with k.k. Now f(1595)=319+63+12+2=396,\begin{aligned}f(1595)&=319+63\\&\quad+12+2=396,\end{aligned} so f(7975)=1595+396=1991.f(7975)=1595+396=1991. For k=1596,k=1596, the same calculation gives f(k)=396,f(k)=396, hence f(5k)=1992.f(5k)=1992. Therefore exactly 15951595 positive values through 19911991 are factorial tails. Of the 19911991 positive integers below 1992,1992, the number omitted is 1991−1595=396.1991-1595=396.
AoPS wiki

Tagged: trailing zeros · factorial · complementary counting

More practice