%I #38 Nov 11 2023 10:35:47
%S 0,1,2,2,3,2,3,2,3,3,4,2,3,3,3,3,4,3,4,3,3,4,5,2,4,3,4,3,4,3,4,3,4,4,
%T 3,3,4,4,3,3,4,3,4,4,3,5,6,3,4,4,4,3,4,4,4,3,4,4,5,3,4,4,3,4,3,4,5,4,
%U 5,3,4,3,4,4,4,4,4,3,4,3,5,4,5,3,4,4,4
%N Number of iterations of lambda(n) needed to reach 1.
%C lambda(n) is the Carmichael lambda function, A002322.
%C a(n) = (length of row n in table A246700) - 1. - _Reinhard Zumkeller_, Sep 02 2014
%H T. D. Noe, <a href="/A185816/b185816.txt">Table of n, a(n) for n = 1..10000</a>
%H Paul Erdős, Andrew Granville, Carl Pomerance, and Claudia Spiro, <a href="http://math.dartmouth.edu/~carlp/iterate.pdf">On the normal behavior of the iterates of some arithmetic functions</a>, Analytic number theory, Birkhäuser Boston, 1990, pp. 165-204.
%H Paul Erdős, Andrew Granville, Carl Pomerance, and Claudia Spiro, <a href="/A000010/a000010_1.pdf">On the normal behavior of the iterates of some arithmetic functions</a>, Analytic number theory, Birkhäuser Boston, 1990, pp. 165-204. [Annotated copy with A-numbers]
%H Paul Erdős, A. Granville, C. Pomerance, and C. Spiro, <a href="https://doi.org/10.1007/978-1-4612-3464-7_13">On the Normal Behavior of the Iterates of some Arithmetic Functions</a>, in Analytic number theory (Allerton Park, IL, 1989), Progr. Math., 85 Birkhäuser Boston, Boston, MA, (1990), 165-204.
%H Nick Harland, <a href="http://arxiv.org/abs/1111.3667">The iterated Carmichael lambda function</a>, arXiv:1111.3667v1 [math.NT], Nov 15, 2011.
%H Nick Harland, <a href="http://arxiv.org/abs/1203.4791">The number of iterates of the Carmichael lambda function required to reach 1</a>, arXiv:1203.4791 [math.NT], Mar 21, 2012.
%F For n > 1: a(n) = a(A002322(n)) + 1. - _Reinhard Zumkeller_, Sep 02 2014
%e If n = 23 the trajectory is 23, 22, 10, 4, 2, 1. Its length is 6, thus a(23) = 5.
%p a:= n-> `if`(n=1, 0, 1+a(numtheory[lambda](n))):
%p seq(a(n), n=1..100); # _Alois P. Heinz_, Apr 27 2019
%t f[n_] := Length[ NestWhileList[ CarmichaelLambda, n, Unequal, 2]] - 2; Table[f[n], {n, 1, 120}]
%o (Haskell)
%o a185816 n = if n == 1 then 0 else a185816 (a002322 n) + 1
%o -- _Reinhard Zumkeller_, Sep 02 2014
%Y Cf. A002322, A036459, A003434.
%Y Cf. A027763, A173927, A246700.
%K nonn
%O 1,3
%A _Michel Lagneau_, Feb 05 2011