OFFSET
1,1
COMMENTS
Up to 10^7, the longest process takes place with 823002 which needs 26 steps.
EXAMPLE
k = 78 (7 steps):
(78*79/2-sigma(78)) mod 78 = 27;
(27*28/2-sigma(27)) mod 27 = 14;
(14*15/2-sigma(14)) mod 14 = 11;
(11*12/2-sigma(11)) mod 11 = 10;
(10*11/2-sigma(10)) mod 10 = 7;
(7*8/2-sigma(7)) mod 7 = 6;
(6*7/2-sigma(6)) mod 6 = 3 and 27 + 14 + 11 + 10 + 7 + 6 + 3 = 78.
MAPLE
with(numtheory): P:=proc(q) local a, b, n, v; v:=[];
for n from 1 to q do a:=0; b:=n; while a<n do b:=((b*(b+1)/2-sigma(b)) mod b);
if b=0 then break; else a:=a+b; fi; od; if a=n then v:=[op(v), n]; fi;
od; op(v); end: P(5*10^5);
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paolo P. Lava, Oct 12 2024
STATUS
approved