A366779 a(n) = lambda(lambda(lambda(n))), where lambda(n) is the Carmichael lambda function (A002322).
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 4, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 4, 10, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 6, 1, 2, 2, 1, 2, 1, 2, 4, 2, 4, 1, 2, 1, 2, 2, 2, 2, 2, 1, 2, 1, 6, 2, 4, 1, 2, 2, 2
Offset: 1
Keywords
Examples
a(5) = 1, since A181776(5) = 2, and A002322(2) = 1.
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..20000
- N. Harland, The iterated Carmichael lambda function, arXiv:1111.3667 [math.NT], 2011.
- G. Martin and C. Pomerance, The iterated Carmichael lambda-function and the number of cycles of the power generator, Acta Arith. 118:4 (2005), pp. 305-335.
Programs
-
Maple
a:= n-> (numtheory[lambda]@@3)(n): seq(a(n), n=1..100); # Alois P. Heinz, Jan 19 2024
-
Mathematica
a[n_]:=Nest[CarmichaelLambda,n,3]; Array[a,87] (* Stefano Spezia, Jan 20 2024 *)
-
PARI
a(n) = lcm(znstar(lcm(znstar(lcm(znstar(11)[2]))[2]))[2])
-
Python
from sympy import reduced_totient def A366779(n): return reduced_totient(reduced_totient(reduced_totient(n))) # Chai Wah Wu, Jan 29 2024