OFFSET
2,1
EXAMPLE
MAPLE
f := proc(n) option remember;
if isprime(n) then
n;
else
procname(convert(numtheory:-factorset(n), `+`));
fi;
end proc:
g := proc(n)
local k;
for k from 1 do
if f(n+k) = f(n) then
return k;
fi;
end do;
end proc:
map(g, [$2..100]);
PROG
(PARI) fp(n, pn) = if (n == pn, n, fp(vecsum(factor(n)[, 1]), n));
f(n) = if (n==1, 0, fp(n, 0));
a(n) = my(k=1, fn=f(n)); while(f(n+k) != fn, k++); k; \\ Michel Marcus, Feb 20 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Rafik Khalfi, Jan 25 2024
STATUS
approved