OFFSET
1,1
LINKS
EXAMPLE
7 is prime and A008908(7) is 17, which is also prime. Therefore, 7 is in the sequence.
MATHEMATICA
collatz[n_]:=If[EvenQ[n], n/2, 3*n+1];
seq[n_]:=Length[NestWhileList[collatz, n, #!= 1&]]
Select[Flatten[Position[seq/@Range[7!], _?PrimeQ]], PrimeQ]
PROG
(PARI) T(n)=c=0; while(n!=1, if(n%2, n=3*n+1; c++); if(!(n%2), n=n/2; c++)); c+1
forprime(p=1, 10^3, if(isprime(T(p)), print1(p, ", "))) \\ Derek Orr, Aug 27 2015
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Ivan N. Ianakiev, Jul 31 2015
STATUS
approved