OFFSET
1,3
COMMENTS
a(n) is in [0,19] for n < 10^5. Conjecture: a(n) exists for all n, i.e. repeated application of f to n eventually yields 1, for any n. The only way this could fail is if n, f(n), f(f(n)), ... are all odd squares.
The conjecture is true, since sequence A055021 (smallest x such that n iterations of sigma() are required for the result to be >= 2x) is complete. - Vim Wenders, Apr 07 2008
EXAMPLE
f(f(f(f(7)))) = f(f(f(8))) = f(f(4)) = f(2) = 1 and 4 applications of f are required to achieve this. Therefore a(7) = 4.
MATHEMATICA
f[n_] := If[EvenQ[n], EulerPhi[n], DivisorSigma[1, n]]; a[n_] := Module[{b=n, k=0}, While[b>1, b=f[b]; k++ ]; k]; Table[a[i], {i, 1, 105}]
Table[Length[NestWhileList[If[EvenQ[#], EulerPhi[#], DivisorSigma[1, #]]&, n, #!=1&]], {n, 110}]-1 (* Harvey P. Dale, Jun 16 2018 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Joseph L. Pe, Jan 23 2002
EXTENSIONS
Edited by Dean Hickerson, Oct 26 2002
STATUS
approved