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”).

For the Collatz (3x+1) iterations starting with a prime number p, a(n) is the smallest p such that the trajectory contains n successive prime numbers.
0

%I #11 May 17 2013 23:29:07

%S 3,3,7,7,7,19,59,59,59,59,157,13397,2312267,97760291,1042776437

%N For the Collatz (3x+1) iterations starting with a prime number p, a(n) is the smallest p such that the trajectory contains n successive prime numbers.

%C a(13)-a(15) were found by Farideh Firoozbakht. See Carlos Rivera's website. - _T. D. Noe_, May 17 2013

%H Carlos Rivera, <a href="http://www.primepuzzles.net/puzzles/puzz_476.htm">Puzzle 476: A question related to Collatz sequence</a>

%e a(11) = 157 because the Collatz sequence of odd numbers is 157 -> 59 -> 89 -> 67 -> 101 -> 19 -> 29 -> 11 -> 17 -> 13 - > 5 -> 1 with 11 consecutive prime numbers.

%p nn:=300:T:=array(1..nn):

%p for n from 1 to 15 do:jj:=0:

%p for m from 2 to 10^5 while(jj=0) do:p:=ithprime(m):

%p for i from 1 to nn while(jj=0) do:

%p T[i]:=0:od:a:=1:T[1]:=p:x:=p:

%p for it from 1 to nn while (x>1) do:

%p if irem(x, 2)=0 then

%p x := x/2:

%p else

%p a:=a+1:T[a]:=x:

%p x := 3*x+1: fi:

%p od:

%p jj:=0:aa:=a:itr:=0:

%p for j from 2 to n+1 do:

%p if type(T[j], prime)=true then

%p itr :=itr+1 :

%p else fi:

%p od:

%p if itr=n then

%p jj:=1: printf ( "%d %d \n",n,p):

%p else

%p fi:

%p od:

%p od:

%t RemoveEven[n_] := n/2^IntegerExponent[n, 2]; Collatz2[n_] := NestWhileList[RemoveEven[3 # + 1] &, n, # > 1 &]; PrimeCnt[lst_] := Module[{i = 1}, While[PrimeQ[lst[[i]]], i++]; i - 1]; nn = 12; t = Table[0, {nn}]; found = 0; n = 2; While[found < nn, n = NextPrime[n]; ps = PrimeCnt[Collatz2[n]]; If[ps > nn, ps = nn]; While[ps > 0 && t[[ps]] == 0, t[[ps]] = n; found++; ps--]]; t (* _T. D. Noe_, May 17 2013 *)

%Y Cf. A006577.

%K nonn,hard

%O 1,1

%A _Michel Lagneau_, May 17 2013