OFFSET
1,1
COMMENTS
If k is a power of 2, then k is in the sequence.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..140
EXAMPLE
The trajectory of 10 is: (10,5,16,8,4,2,1) and phi(10) = 4 is reached, hence 10 is in the sequence.
MATHEMATICA
c[n_] := If[OddQ[n], 3*n + 1, n/2]; q[2] = True; q[n_] := NestWhile[c, n, # != EulerPhi[n] && # > 1 &] > 1; Select[Range[500], q] (* Amiram Eldar, Apr 29 2022 *)
PROG
(PARI) for(n=1, 10000, s=n; t=0; while(s!=1, t++; if(s%2==0, s=s/2, s=3*s+1); if(s==eulerphi(n), print1(n, ", "); ); ))
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Benoit Cloitre, May 18 2002
STATUS
approved