OFFSET
1,1
COMMENTS
a(n+1)/a(n) ~= 5.
Any number that is a multiple of 2^n and not of 5 can be the last digits of 2^k (mod 10^n) for some k. Furthermore 2^k can be the last n digits of 2^k for 1 <= k <= n-1. Giving a size of 4/5 * 5^n + n-1 = 4*5^(n-1) + n-1 for that set. - David A. Corneth, Apr 21 2021
FORMULA
a(n) = 4*5^(n-1)+(n-1). - David A. Corneth, Apr 21 2021
EXAMPLE
a(1) = 4 as 2^k (mod 10) = |{2 (mod 10), 4 (mod 10), 8 (mod 10), 16 (mod 10), 32 (mod 10)}| = |{2, 4, 6, 8}| = 4 for k = 1..5 respectively (note that only distinct terms are counted).
MATHEMATICA
Do[ Print[ Length[ Union[ Table[ PowerMod[2, i, 10^n], {i, 5^n}]] ]], {n, 10}]
PROG
(Python)
def a(n):
modder = 10**n
return len(set(pow(2, k, modder) for k in range(1, 5**n+1)))
print([a(n) for n in range(1, 10)]) # Michael S. Branicky, Apr 21 2021
(PARI) a(n) = 4*5^(n-1)+(n-1) \\ David A. Corneth, Apr 21 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul D. Hanna and Robert G. Wilson v, Aug 27 2004
EXTENSIONS
a(11)-a(12) from Robert G. Wilson v, Sep 16 2012
Title edited by Michael S. Branicky, Apr 21 2021
More terms from David A. Corneth, Apr 21 2021
STATUS
approved