OFFSET
1,2
COMMENTS
a(n) = 0 for n = 1, 44, 125, 373, 1123, 1353, 5071, 19577, …
LINKS
Michel Lagneau, Table of n, a(n) for n = 1..5000
MAPLE
with(numtheory):a0:=0:for n from 2 to 100 do: x:=factorset(n):n1:=nops(x): p:=x[n1]:a1:=a0-p:if a1< 0 then a1:=a0+p:else fi: printf(`%d, `, a1): a0:=a1: od:
MATHEMATICA
nxt[{n_, a_}]:=Module[{lpf=FactorInteger[n+1][[-1, 1]]}, {n+1, If[ a-lpf> = 0, a-lpf, a+lpf]}]; Transpose[NestList[nxt, {1, 0}, 70]][[2]] (* Harvey P. Dale, Jan 15 2015 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Jan 23 2012
EXTENSIONS
Definition modified by Harvey P. Dale, Jan 15 2015
STATUS
approved