%I #15 Nov 18 2017 20:59:43
%S 1,1,2,2,2,2,3,1,2,3,3,1,3,2,2,3,3,4,2,2,4,2,2,3,4,2,4,4,2,3,4,4,4,5,
%T 4,3,5,4,4,4,2,5,3,4,4,4,4,2,4,3,4,6,5,5,4,5,5,4,4,2,4,5,3,4,4,3,5,4,
%U 5,3,4,2,4,4,3,3,5,3,5,3,4,4,4,3,4,5,5,3,4,3,3,3,5,3,5,2,6,4,3,7,5,3,3,3,5
%N Function A062401(x) = phi(sigma(x)) = f(x) is iterated. Starting with n, a(n) is the count of distinct terms arising in trajectory; a(n)=t(n)+c(n)=t+c, where t=number of transient terms, c=number of recurrent terms (in the terminal cycle).
%H Antti Karttunen, <a href="/A096859/b096859.txt">Table of n, a(n) for n = 1..16384</a>
%e n=255: list={255,144,360,288,[432,480],432,...}, t=transient=4, c=cycle=2, a(255)=t+c=6;
%e n=244: list={244,180,144,360,288,[432,480],432,...}, t=5, c=2, a(244)=7.
%t fs[x_] :=EulerPhi[DivisorSigma[1, x]] itef[x_, len_] :=NestList[fs, x, len] Table[Length[Union[itef[2^w, 20]]], {w, 1, 256}] (* len=20 at n<=256 is suitable *)
%o (Scheme) (define (A096859 n) (let loop ((visited (list n)) (i 1)) (let ((next (A062401 (car visited)))) (cond ((member next visited) i) (else (loop (cons next visited) (+ 1 i))))))) ;; _Antti Karttunen_, Nov 18 2017
%Y Cf. A000010, A000203, A062401, A062402, A095955, A096860, A096861, A096865.
%Y Cf. also A096862.
%K nonn
%O 1,3
%A _Labos Elemer_, Jul 21 2004