|
|
A185112
|
|
a(1)= 0; for n > 1, a(n) = a(n-1) - P(n) if that number is zero or positive, otherwise a(n)= a(n-1)+ P(n), where P(n) is the largest prime factor of n (A006530).
|
|
2
|
|
|
0, 2, 5, 3, 8, 5, 12, 10, 7, 2, 13, 10, 23, 16, 11, 9, 26, 23, 4, 9, 2, 13, 36, 33, 28, 15, 12, 5, 34, 29, 60, 58, 47, 30, 23, 20, 57, 38, 25, 20, 61, 54, 11, 0, 5, 28, 75, 72, 65, 60, 43, 30, 83, 80, 69, 62, 43, 14, 73, 68, 7, 38, 31, 29, 16, 5, 72, 55, 32, 25
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
a(n) = 0 for n = 1, 44, 125, 373, 1123, 1353, 5071, 19577, …
|
|
LINKS
|
|
|
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
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|