OFFSET
1,2
LINKS
FORMULA
PROG
(Scheme, with memoization-macro definec)
(definec (A284571 n) (cond ((= 1 n) n) ((not (zero? (A008683 n))) (* 2 (A284571 (A013928 n)))) (else (+ 1 (* 2 (A284571 (+ -1 (A285328 n))))))))
(Python)
from operator import mul
from sympy import primefactors
from sympy.ntheory.factor_ import core
def a007947(n): return 1 if n<2 else reduce(mul, primefactors(n))
def a285328(n):
if core(n) == n: return 1
k=n - 1
while k>0:
if a007947(k) == a007947(n): return k
else: k-=1
def a013928(n): return sum(1 for i in range(1, n) if core(i) == i)
def a(n):
if n==1: return 1
if core(n)==n: return 2*a(a013928(n))
else: return 1 + 2*a(a285328(n) - 1)
[a(n) for n in range(1, 121)] # Indranil Ghosh, Apr 17 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Apr 17 2017
STATUS
approved