OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Harvey P. Dale)
FORMULA
a(n) = n*5^floor(log_5(n)+1) + n. - Ilya Gutkovskiy, Jan 26 2018
EXAMPLE
182_10 = 1212_5. - Jon E. Schoenfield, Feb 11 2021
MATHEMATICA
tis5Q[n_]:=Module[{idn=IntegerDigits[n, 5], len}, len=Length[idn]; EvenQ[len] && Take[idn, len/2]==Take[idn, -len/2]]; Select[Range[6500], tis5Q] (* or *) Flatten[Table[FromDigits[#, 5]&/@Select[(Flatten[{#, #}]&/@Tuples[ Range[ 0, 4], n]), #[[1]]!=0&], {n, 3}]] (* The second program is significantly faster than the first. *) (* Harvey P. Dale, Apr 08 2013 *)
a[n_] := n + n*5^Floor[Log[5, n] + 1]; Array[a, 50] (* Amiram Eldar, Apr 06 2021 *)
PROG
(Python)
from itertools import count, product
def agen():
for d in count(1):
for first in "1234":
for p in product("01234", repeat=d-1):
yield int((first+"".join(p))*2, 5)
g = agen()
print([next(g) for n in range(1, 49)]) # Michael S. Branicky, Jun 12 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
David W. Wilson, Melia Aldridge (ma38(AT)spruce.evansville.edu)
STATUS
approved