%I #23 Apr 22 2021 04:48:06
%S 4,21,102,503,2504,12505,62506,312507,1562508,7812509,39062510,
%T 195312511,976562512,4882812513,24414062514,122070312515,610351562516,
%U 3051757812517,15258789062518,76293945312519,381469726562520,1907348632812521,9536743164062522,47683715820312523,238418579101562524
%N a(n) = size of union of 2^k (mod 10^n), 0 < k <= 5^n.
%C a(n+1)/a(n) ~= 5.
%C 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
%F a(n) = 4*5^(n-1)+(n-1). - _David A. Corneth_, Apr 21 2021
%e 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).
%t Do[ Print[ Length[ Union[ Table[ PowerMod[2, i, 10^n], {i, 5^n}]] ]], {n, 10}]
%o (Python)
%o def a(n):
%o modder = 10**n
%o return len(set(pow(2, k, modder) for k in range(1, 5**n+1)))
%o print([a(n) for n in range(1, 10)]) # _Michael S. Branicky_, Apr 21 2021
%o (PARI) a(n) = 4*5^(n-1)+(n-1) \\ _David A. Corneth_, Apr 21 2021
%Y Cf. A095810, A113023.
%K nonn,easy
%O 1,1
%A _Paul D. Hanna_ and _Robert G. Wilson v_, Aug 27 2004
%E a(11)-a(12) from _Robert G. Wilson v_, Sep 16 2012
%E Title edited by _Michael S. Branicky_, Apr 21 2021
%E More terms from _David A. Corneth_, Apr 21 2021
|