%I #27 May 29 2022 21:42:30
%S 6,7,9,14,18,19,27,38,54,81,162,163,243,326,486,487,729,974,1458,1459,
%T 2187,2918,4374,6561,13122,19683,39366,39367,59049,78734,118098,
%U 177147,354294,531441,1062882,1594323,3188646,4782969,9565938,14348907,28697814,43046721,86093442,86093443,129140163,172186886
%N Numbers k such that iterations of phi(k), phi(phi(k)), ... end in ... 6, 2, 1.
%C Infinite set (see reference).
%C Contains 3^k for k >= 2 and 2*3^k for k >= 1, and all members of A111974 except 3. - _Robert Israel_, Dec 23 2021
%H Robert Israel, <a href="/A340765/b340765.txt">Table of n, a(n) for n = 1..1000</a>
%H Eliot T. Jacobson and Alan E. Parks, <a href="https://www.jstor.org/stable/2323032">Infinite branches of the phi-tree</a>, Amer. Math. Monthly, Vol. 93, No. 7 (August-September 1986), pp. 552-554.
%H Keith Matthews, <a href="http://www.numbertheory.org/php/carmichael.html">Solving phi(x)=n, where phi(x) is Euler's totient function</a>.
%e 19 is in the list because phi(phi(19)) = phi(18) = 6.
%p R:= {6}: Agenda:= {6}: count:= 1:
%p while count - nops(Agenda) < 99 do
%p v:= min(Agenda);
%p W:= convert(numtheory:-invphi(v),set);
%p count:= count + nops(W);
%p Agenda:= Agenda minus {v} union W;
%p R:= R union W;
%p od:
%p sort(select(`<=`, convert(R,list),min(Agenda))); # _Robert Israel_, Dec 23 2021
%t Select[Range[4, 10000], FixedPointList[EulerPhi, #][[-4]] == 6 &] (* _Amiram Eldar_, Jan 27 2021 *)
%o (PARI) isok(k) = if (k>=6, while((k!=6) && (k!=4), k=eulerphi(k))); k == 6; \\ _Michel Marcus_, Feb 01 2021
%Y Cf. A000010, A340762 (complement relative to {n>=4}).
%Y Cf. A003434, A032358, A049108, A111974.
%K nonn
%O 1,1
%A _Franz Vrabec_, Jan 20 2021