[go: up one dir, main page]

login
A113022
a(n) = size of union of 2^k (mod 10^n), 0 < k <= 5^n.
2
4, 21, 102, 503, 2504, 12505, 62506, 312507, 1562508, 7812509, 39062510, 195312511, 976562512, 4882812513, 24414062514, 122070312515, 610351562516, 3051757812517, 15258789062518, 76293945312519, 381469726562520, 1907348632812521, 9536743164062522, 47683715820312523, 238418579101562524
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
Sequence in context: A076901 A080043 A240456 * A291184 A014986 A015531
KEYWORD
nonn,easy
AUTHOR
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