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.