Problem:
For each positive integer n, let
an​=(n−1)!(n+9)!​
Let k denote the smallest positive integer for which the rightmost nonzero digit of ak​ is odd. The rightmost nonzero digit of ak​ is
Answer Choices:
A. 1
B. 3
C. 5
D. 7
E. 9
Solution:
Factor an​ as a product of prime powers:
an​=n(n+1)(n+2)⋯(n+9)=2e1​3e2​5e3​⋯
Among the ten factors n,n+1,…,n+9, five are even and their product can be written 25m(m+1)(m+2)(m+3)(m+4). If m is even then m(m+2)(m+4) is divisible by 16 and thus e1​≥9. If m is odd, then e1​≥8. If e1​>e3​, then the rightmost nonzero digit of an​ is even. If e1​≤e3​, then the rightmost nonzero digit of an​ is odd. Hence we seek the smallest n for which e3​≥e1​. Among the ten numbers n,n+1,…,n+9, two are divisible by 5 and at most one of these is divisible by 25. Hence e3​≥8 if and only if one of n,n+1,…,n+9 is divisible by 57. The smallest n for which an​ satisfies e3​≥8 is thus n=57−9, but in this case the product of the five even numbers among n,n+1,…,n+9 is 25m(m+1)(m+2)(m+3)(m+4) where m is even, namely (57−9)/2=39058. As noted earlier, this gives e1​≥9. For n=57−8=78117, the product of the five even numbers among n,n+1,…,n+9 is 25m(m+1)(m+2)(m+3)(m+4) with m=39059. Note that in this case e1​=8. Indeed, 39059+1 is divisible by 4 but not by 8, and 39059+3 is divisible by 2 but not by 4. Compute the rightmost nonzero digit as follows. The odd numbers among n,n+1,…,n+9 are 78117​​,78119​​,78121​,78123​,78125=57 and the product of the even numbers 78118,78120,78122,78124,78126 is 25⋅39059⋅39060⋅39061⋅39062⋅39063=25⋅39059​⋅(22⋅5⋅1953​)⋅39061​⋅(2⋅19531​)⋅39063​. (For convenience, we have underlined the needed unit digits.) Having written n(n+1)⋯(n+9) as 2858 times a product of odd factors not divisible by 5, we determine the rightmost nonzero digit by multiplying the units digits of these factors. It follows that, for n=57−8, the rightmost nonzero digit of an​ is the units digit of 7⋅9⋅1⋅3⋅9⋅3⋅1⋅1⋅3=(9⋅9)⋅(7⋅3)⋅(3⋅3), namely 9.