login
A334685
Start with n, and successively apply phi, phi, sigma, phi, phi, sigma, phi, ... until reaching 1; a(n) is the number of steps needed (phi = A000010, sigma = A000203); or a(n) = -1 if 1 is never reached.
5
0, 1, 2, 2, 5, 2, 5, 5, 5, 5, 8, 5, 8, 5, 8, 8, 11, 5, 8, 8, 8, 8, 8, 8, 11, 8, 8, 8, 11, 8, 11, 11, 11, 11, 11, 8, 11, 8, 11, 11, 14, 8, 11, 11, 11, 8, 11, 11, 11, 11, 14, 11, 14, 8, 14, 11, 11, 11, 14, 11, 14, 11, 11, 14, 14, 11, 11, 14, 11, 11, 14, 11, 14, 11, 14, 11, 14, 11, 14, 14, 14, 14, 14, 11, 14, 11, 14, 14
OFFSET
1,3
COMMENTS
Created following a suggestion from R. J. Mathar in an attempt to understand A032452.
LINKS
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