Problem #202
Power and Modulo
F(k) = 5^k mod (10^{k'}) where k' = k mod 6
Let S(N) be the sum of F(k) for all 1 \leq k \leq N.
Find S(10^{18}) mod 10^9+7.
F(k) = 5^k mod (10^{k'}) where k' = k mod 6
Let S(N) be the sum of F(k) for all 1 \leq k \leq N.
Find S(10^{18}) mod 10^9+7.