login
A334686
Start with n, and successively apply phi, phi, sigma', phi, phi, sigma', phi, ... until reaching either 0 or 1; a(n) is the number of steps needed (phi = A000010, sigma' = A001065); or a(n) = -1 if 0 or 1 is never reached.
5
0, 1, 2, 2, 3, 2, 3, 3, 3, 3, 5, 3, 5, 3, 5, 5, 6, 3, 5, 5, 5, 5, 6, 5, 6, 5, 5, 5, 8, 5, 6, 6, 6, 6, 6, 5, 8, 5, 6, 6, 8, 5, 8, 6, 6, 6, 6, 6, 8, 6, 8, 6, 8, 5, 8, 6, 8, 8, 8, 6, 8, 6, 8, 8, 8, 6, 8, 8, 8, 6, 8, 6, 8, 8, 8, 8, 8, 6, 8, 8, 8, 8, 9, 6, 9, 8, 8, 8, 9, 6, 8, 8, 8, 6, 8, 8, 9, 8, 8, 8, 9, 8, 9, 8, 8, 8
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=7 is 7, 6, 2, 1, ... which takes three steps to reach 0 or 1, so a(7) = 3.
MATHEMATICA
A334686[n_]:=Module[{i=0}, NestWhile[If[Mod[i++, 3]==2, DivisorSigma[1, #]-#, EulerPhi[#]]&, n, #>1&]; i]; Array[A334686, 100] (* Paolo Xausa, Nov 16 2023 *)
PROG
(PARI) a(n) = { for (k=0, oo, if (n<=1, return (k), k%3==2, n=sigma(n)-n, n=eulerphi(n))) } \\ Rémy Sigrist, May 09 2020
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, May 08 2020
STATUS
approved