Problem:
Let N be the number of consecutive 0's at the right end of the decimal representation of the product 1!2!3!4!⋯99!100!. Find the remainder when N is divided by 1000.
Solution:
Let P=1!2!3!4!⋯99!100!. Then N is equal to the number of factors of 5 in P. For any positive integer k, the number of factors of 5 is the same for (5k)!,(5k+1)!,(5k+2)!,(5k+3)!, and (5k+4)!. The number of factors of 5 in (5k)! is 1 more than the number of factors of 5 in (5k−1)! if 5k is not a multiple of 25; and the number of factors of 5 in (5k)! is 2 more than the number of factors of 5 in (5k−1)! if 5k is a multiple of 25 but not 125.
Thus
N=4â‹…0+5(1+2+3+4+6+7+8+9+10+12+13+14+15+16+18+19+20+21+22)+24.
This sum is equal to
5⋅(222⋅23​−(5+11+17))+24=1124
so the required remainder is 124​.
OR
Let P=1!2!3!4!⋯99!100!. Then N is equal to the number of factors of 5 in P. When the factorials in P are expanded, 5 appears 96 times (in 5!,6!,…,100!), 10 appears 91 times, and, in general, n appears 101−n times. Every appearance of a multiple of 5 yields a factor of 5, and every appearance of a multiple of 25 yields an additional factor of 5. The number of multiples of 5 is 96+91+86+⋯+1=970, and the number of multiples of 25 is 76+51+26+1=154, so P ends in 970+154=1124 zeros. The required remainder is 124​.
The problems on this page are the property of the MAA's American Mathematics Competitions