login
A292384
a(1) = 1; for n > 1, a(n) = 4*a(A252463(n)) + (n mod 4).
7
1, 6, 27, 24, 109, 110, 439, 96, 97, 438, 1759, 440, 7037, 1758, 443, 384, 28149, 390, 112599, 1752, 1753, 7038, 450399, 1760, 389, 28150, 387, 7032, 1801597, 1774, 7206391, 1536, 7033, 112598, 1775, 1560, 28825565, 450398, 28155, 7008, 115302261, 7014, 461209047, 28152, 1761, 1801598, 1844836191, 7040, 1557, 1558, 112603, 112600
OFFSET
1,2
COMMENTS
a(n) encodes in its base-4 representation the succession of modulo 4 residues obtained when map x -> A252463(x), starting from x=n, is iterated down to the eventual 1.
LINKS
FORMULA
a(1) = 1; for n > 1, a(n) = 4*a(A252463(n)) + A010873(n).
PROG
(Scheme, with memoization-macro definec)
(definec (A292384 n) (if (= 1 n) n (+ (modulo n 4) (* 4 (A292384 (A252463 n))))))
(Python)
from sympy.core.cache import cacheit
from sympy import factorint, prevprime, prod
def a064989(n):
f = factorint(n)
return 1 if n == 1 else prod(prevprime(i)**f[i] for i in f if i != 2)
def a252463(n): return 1 if n==1 else n//2 if n%2==0 else a064989(n)
@cacheit
def a(n): return 1 if n==1 else 4*a(a252463(n)) + n%4
print([a(n) for n in range(1, 51)]) # Indranil Ghosh, Sep 21 2017
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Sep 15 2017
STATUS
approved