OFFSET
1,2
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
By the definition of a(n) we have for n >= 2 the recursion a(n) = a(Phi(n)) + 1. - Ahmed Fares (ahmedfares(AT)my-deja.com), Apr 20 2001
log_3 n << a(n) << log_2 n. - Charles R Greathouse IV, Feb 07 2012
EXAMPLE
If n=164 the trajectory is {164,80,32,16,8,4,2,1}. Its length is 8, thus a(164)=8.
MAPLE
A049108 := proc(n)
local a, e;
e := n ;
a :=0 ;
while e > 1 do
a := a+1 ;
e := numtheory[phi](e) ;
end do:
1+a;
end proc:
seq(A049108(n), n=1..60) ; # R. J. Mathar, Sep 08 2021
MATHEMATICA
f[n_] := Length[NestWhileList[ EulerPhi, n, # != 1 &]]; Array[f, 105] (* Robert G. Wilson v, Feb 07 2012 *)
PROG
(PARI) a(n)=my(t=1); while(n>1, t++; n=eulerphi(n)); t \\ Charles R Greathouse IV, Feb 07 2012
CROSSREFS
KEYWORD
nonn,nice,easy
AUTHOR
STATUS
approved