login
A066903
Primes in A006577.
5
7, 2, 5, 3, 19, 17, 17, 7, 7, 23, 5, 13, 13, 109, 29, 11, 11, 11, 19, 19, 19, 19, 107, 107, 17, 17, 17, 17, 113, 113, 113, 7, 41, 41, 103, 103, 23, 23, 23, 23, 23, 23, 23, 67, 31, 31, 31, 31, 31, 31, 13, 13, 13, 13, 101, 101, 13, 13, 127, 83, 127, 47, 47, 109, 47, 109, 109
OFFSET
1,1
LINKS
EXAMPLE
a(1) = 7 because the first prime in A006577 is A006577(3) = 7.
MAPLE
N:= 1000; # to get the first N terms
Collatz:= proc(n) option remember;
if n::even then 1+Collatz(n/2)
else 1+Collatz(3*n+1)
fi
end proc;
Collatz(1):= 0;
count:= 0;
for i from 1 while count < N do
x:= Collatz(i);
if isprime(x) then count:= count+1; A[count]:= x fi;
od:
seq(A[i], i=1..N); # Robert Israel, Jun 01 2014
MATHEMATICA
M = 100;
Collatz[n_] := Collatz[n] = If[EvenQ[n], 1+Collatz[n/2], 1+Collatz[3n+1]];
Collatz[1] = 0;
count = 0;
For[i = 1, count < M, i++, x = Collatz[i]; If[PrimeQ[x], count = count+1; a[count] = x]];
Array[a, M] (* Jean-François Alcover, Mar 26 2019, after Robert Israel *)
CROSSREFS
Cf. A006577.
Sequence in context: A372913 A366599 A352890 * A194886 A196764 A074457
KEYWORD
nonn,look
AUTHOR
K. B. Subramaniam (kb_subramaniambalu(AT)yahoo.com), Dec 20 2001
EXTENSIONS
More terms from Sascha Kurz, Mar 23 2002
Offset corrected by Robert Israel, Jun 01 2014
STATUS
approved