Problem:
Define a positive integer n to be a "factorial tail" if there is some positive integer m such that the base-ten representation of m! ends with exactly n zeros. How many positive integers less than 1992 are not factorial tails?
Solution:
Let f(m) be the number of ending zeros in the decimal expansion of m !. It is clear that f(m) is a nondecreasing function of m. Furthermore, when m is a multiple of 5 we have
f(m)=f(m+1)=f(m+2)=f(m+3)=f(m+4)<f(m+5)
Thus if we list the numbers f(k) for k=0,1,2,…, we obtain
0,0,0,0,0,1,1,1,1,1,2,2,2,2,2,…,4,4,4,4,4,6,6,6,6,6,…(*)
and each number in this list appears 5 times. We would like to know if the number 1991 appears in this list. It is well known (and easy to show) that the number of zeros at the end of m! is
f(m)=k=1∑∞​⌊5km​⌋
If there is an m for which f(m)=1991, then
1991<k=1∑∞​5km​=m1−51​51​​=4m​
Hence m>4⋅1991=7964. Using the above formula for f(m) we find that f(7965)=1988, and once this is known we can readily ascertain that f(7975)=1991. Now if the list (∗) is carried out to the term f(7979)=1991 we have
0,0,0,0,0,1,1,1,1,1,…,1989,1991,1991,1991,1991,1991
This list contains 7980 terms, and each integer in the sequence occurs exactly 5 times. Thus the list has 57980​=1596 distinct integer values from the set {0,1,2,…,1991}. Hence 1992−1596=396 of these integers do not appear in the list. Consequently there are 396 positive integers less than 1992 that are not factorial tails.
The problems on this page are the property of the MAA's American Mathematics Competitions