OFFSET
1,41
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
For n = 163, the successive iterates applying Euler totient function are as follows: 163, 162, 54, 18, 6, 2, 1. The 6th term is 2, when Phi was applied 5 times. So a(163)=2, already a power of 2.
For n = 487, the successive iterates are 486, 162, 54, 18, 6, 2, 1. On the fifth iteration we reach 6, thus a(487) = 6. This is also the first term of A049107 that is not a power of 2. - Antti Karttunen, Aug 22 2017
MATHEMATICA
a(n)=Nest[ EulerPhi, n, 5 ]
Nest[EulerPhi, Range[110], 5] (* Harvey P. Dale, May 19 2019 *)
PROG
(PARI) A049107(n) = eulerphi(eulerphi(eulerphi(eulerphi(eulerphi(n))))); \\ Antti Karttunen, Aug 22 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved