login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A260303
For the Collatz (3x+1) iteration starting at k, the sequence lists the smallest k such that prime(n) belongs to the trajectory of k, or 0 if no such k exists.
2
3, 6, 3, 9, 7, 7, 7, 25, 15, 19, 27, 43, 27, 57, 27, 15, 39, 27, 39, 27, 97, 105, 55, 39, 129, 39, 27, 27, 145, 75, 169, 87, 27, 123, 99, 201, 123, 217, 27, 115, 79, 241, 127, 171, 87, 235, 187, 297, 151, 135, 27, 159, 321, 27, 171, 27, 79, 361, 369, 187, 27, 195
OFFSET
1,1
COMMENTS
The initial term k is not counted as an element of the trajectory.
LINKS
EXAMPLE
a(1)=3 because 2 = prime(1) in the trajectory 3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1;
a(2)=6 because 3 = prime(2) is in the trajectory 6 -> 3 -> 10 -> ... -> 1;
a(3)=3 because 5 = prime(3) is in the trajectory 3 -> 10 -> 5 -> ... -> 1;
a(4)=9 because 7 = prime(4) is in the trajectory 9 -> 28 -> 14 -> 7 -> ... -> 1.
MAPLE
with(numtheory):
for n from 1 to 100 do:
jj:=0:
for k from 1 to 10^6 while(jj=0) do:
lst:={}:m:=k:ii:=0:it:=10^6:
for i from 1 to it while(ii=0) do:
if irem(m, 2)=0
then
m:=m/2:
else m:=3*m+1:
fi:
lst:=lst union {m}:
if m=1
then
ii:=1:
else
fi:
od:
n0:=nops(lst):
for j from 1 to n0 while(jj=0)do:
if ithprime(n)=lst[j]
then
jj:=1:
else fi:
od:
if jj=1 then printf(`%d, `, k):
else fi:
od:od:
CROSSREFS
Sequence in context: A065231 A351102 A019918 * A055373 A263333 A328371
KEYWORD
nonn
AUTHOR
Michel Lagneau, Nov 21 2015
STATUS
approved