OFFSET
1,3
COMMENTS
Created following a suggestion from R. J. Mathar in an attempt to understand A032452.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..25000
L. Alaoglu and P. Erdős, A conjecture in elementary number theory, Bull. Amer. Math. Soc. 50 (1944), 881-882.
EXAMPLE
The trajectory of n=11 is 11, 10, 4, 7, 6, 2, 3, 2, 1, 1, 1, ..., which takes eight steps to reach 1, so a(11) = 8.
MATHEMATICA
Array[-1 + Length@ NestWhile[Append[#1, If[#2 == 0, DivisorSigma[1, #1[[-1]]], EulerPhi@ #1[[-1]] ]] & @@ {#, Mod[Length@ #, 3]} &, {#}, Last[#] > 1 &] &, 80] (* Michael De Vlieger, May 09 2020 *)
PROG
(PARI) a(n) = { for (k=0, oo, if (n==1, return (k), k%3==2, n=sigma(n), n=eulerphi(n))) } \\ Rémy Sigrist, May 09 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, May 08 2020
STATUS
approved