MathDB
last nonzero digit of (5^a+5^b+...)!, find periodicity

Source: Putnam 1984 A6

September 2, 2021
number theorySequences

Problem Statement

Let nn be a positive integer, and let f(n)f(n) denote the last nonzero digit in the decimal expansion of n!n!.
(a)(\text a) Show that if a1,a2,,aka_1,a_2,\ldots,a_k are distinct nonnegative integers, then f(5a1+5a2++5ak)f(5^{a_1}+5^{a_2}+\ldots+5^{a_k}) depends only on the sum a1+a2++aka_1+a_2+\ldots+a_k. (b)(\text b) Assuming part (a)(\text a), we can define g(s)=f(5a1+5a2++5ak),g(s)=f(5^{a_1}+5^{a_2}+\ldots+5^{a_k}),where s=a1+a2++aks=a_1+a_2+\ldots+a_k. Find the least positive integer pp for which g(s)=g(s+p),for all s1,g(s)=g(s+p),\enspace\text{for all }s\ge1,or show that no such pp exists.