login
A329656
Starting at k = A001414(n), iterate k -> n mod k until k=0. a(n) is the number of steps taken.
2
0, 1, 1, 1, 1, 2, 1, 2, 2, 3, 1, 3, 1, 4, 3, 1, 1, 2, 1, 2, 2, 4, 1, 2, 2, 4, 1, 3, 1, 1, 1, 2, 3, 4, 4, 2, 1, 4, 4, 3, 1, 2, 1, 3, 2, 4, 1, 2, 2, 2, 5, 2, 1, 4, 4, 2, 5, 4, 1, 1, 1, 4, 4, 2, 4, 2, 1, 4, 3, 1, 1, 1, 1, 4, 3, 4, 4, 2, 1, 2, 2, 4, 1, 1, 5, 4, 6, 3, 1, 3, 4, 3, 4, 4, 5, 3, 1, 2, 3
OFFSET
1,6
COMMENTS
If n is prime, a(n)=1.
LINKS
EXAMPLE
A001414(6) = 2+3 = 5, 6 mod 5 = 1, 6 mod 1 = 0 so a(6) = 2.
MAPLE
f:= proc(n) local s, t;
s:= convert(map(convert, ifactors(n)[2], `*`), `+`);
for t from 1 do
s:= n mod s;
if s = 0 then return t fi
od
end proc:
f(1):= 0:
map(f, [$1..200]);
MATHEMATICA
sopfr[n_] := If[n == 1, 0, Total[Times @@@ FactorInteger[n]]];
f[n_] := Module[{s, t}, s = sopfr[n]; For[t = 1, True, t++, s = Mod[n, s]; If[s == 0, Return [t]]]]; f[1] = 0;
Array[f, 200] (* Jean-François Alcover, Aug 22 2020, after Maple *)
CROSSREFS
Cf. A001414.
Sequence in context: A176853 A261787 A302480 * A000374 A355735 A355733
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Nov 18 2019
STATUS
approved