OFFSET
1,4
COMMENTS
After the initial zero, all terms are squarefree numbers (A005117).
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10000
FORMULA
PROG
(Scheme) (define (A286104 n) (cond ((= 1 n) 0) ((< (A286103 (A285734 n)) (A286103 (A285735 n))) (A285734 n)) (else (A285735 n))))
(Python)
from sympy.ntheory.factor_ import core
def issquarefree(n): return core(n) == n
def a285734(n):
if n==1: return 0
j=n//2
while True:
if issquarefree(j) and issquarefree(n - j): return j
else: j-=1
def a285735(n): return n - a285734(n)
def a286103(n): return 0 if n==1 else 1 + min(a286103(a285734(n)), a286103(a285735(n)))
def a286104(n): return 0 if n==1 else a285734(n) if a286103(a285734(n)) < a286103(a285735(n)) else a285735(n)
print([a286104(n) for n in range(1, 121)]) # Indranil Ghosh, May 02 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 02 2017
STATUS
approved