OFFSET
1,1
COMMENTS
Up to 10^7, the longest process takes place with 35966, 143864, 575456, 971082, 2301824, 3884328 and 9207296 which need 8 steps.
EXAMPLE
k = 146 (3 steps):
146' mod 146 = 75;
75' mod 75 = 55;
55' mod 55 = 16 and 75 + 55 + 16 = 146.
k = 248 (4 steps):
248' mod 248 = 132;
132' mod 132 = 56;
56' mod 56 = 36;
36' mod 36 = 24 and 132 + 56 + 36 + 24 = 248.
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*add(op(2, p)/op(1, p), p=ifactors(b)[2]) 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(10^4);
CROSSREFS
KEYWORD
nonn,easy,new
AUTHOR
Paolo P. Lava, Jan 05 2025
STATUS
approved