OFFSET
1,3
COMMENTS
By convention, gpf(1) = lpf(1) = 1.
a(n) = 0 for n = 1, 4, 154, 186, 287, 641, 903, 980, 1626, 1847, 3761, 5024, 11563, 20471, 23046, 31082, 31219, 34866, 40339, ...
LINKS
Michel Lagneau, Table of n, a(n) for n = 1..10000
EXAMPLE
a(1) = 0;
a(2) = a(1) + lpf(1) = 0 + 1 = 1 because a(1) < gpf(1);
a(3) = a(2) + lpf(2) = 1 + 2 = 3 because a(2) < gpf(2);
a(4) = a(3) - gpf(3) = 3 - 3 = 0 because a(3) = gpf(3);
a(5) = a(4) + gpf(4) = 0 + 2 = 2 because a(4) < gpf(4);
a(6) = a(5) + gpf(5) = 2 + 5 = 7 because a(5) < gpf(5);
a(7) = a(6) - gpf(6) = 7 - 3 = 4 because a(6) > gpf(6).
MAPLE
with(numtheory):a1:=1:printf(`%d, `, 0):printf(`%d, `, 1):
for n from 2 to 200 do :
x:=factorset(n):n1:=nops(x):d:=x[n1]:
if a1-d<0
then
a1:=a1+x[1]:
else
a1:=a1-d:
fi:
printf(`%d, `, a1):
od:
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Oct 15 2014
STATUS
approved