Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #27 Jun 23 2022 20:39:19
%S 5,13,17,53,61,107,251,283,1367
%N Odd primes p such that p is in the trajectory of p+1 under the Collatz 3x+1 map (A014682).
%C a(10) > 10^7 if it exists. - _Felix Fröhlich_, Aug 26 2016
%C a(10) > 10^9 if it exists. - _Charles R Greathouse IV_, Aug 26 2016
%C a(10) > 10^12 if it exists. - _Charles R Greathouse IV_, Sep 07 2016
%H <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>
%t Select[Prime@ Range[2, 10^5], MemberQ[NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, # + 1, # > 1 &], #] &] (* _Michael De Vlieger_, Aug 26 2016 *)
%o (JavaScript) function isit_collatz_prime(p)
%o {
%o var cur = p+1;
%o while(cur != p && cur != 2)
%o {
%o if(cur%2!=0)
%o {
%o cur = 3*cur + 1;
%o }else
%o {
%o cur = cur/2;
%o }
%o }
%o if(cur === p ){return "p is a Collatz prime";}
%o else {return "p is not a Collatz prime";}
%o }
%o (PARI) next_collatz_iteration(n) = if(n%2==1, return(3*n+1), return(n/2))
%o is(n) = if(n%2==1 && ispseudoprime(n), my(k=n+1); while(k > 1, k=next_collatz_iteration(k); if(k==n, return(1)))); 0 \\ _Felix Fröhlich_, Aug 26 2016
%o (PARI) has(n)=my(k=n+1); k>>=valuation(k,2); while(k>1, k+=(k+1)>>1; k>>=valuation(k,2); if(k==n, return(1))); 0
%o forprime(p=3,1e9, if(has(p), print1(p", "))) \\ _Charles R Greathouse IV_, Aug 26 2016
%Y Cf. A014682, A276290.
%K nonn,more
%O 1,1
%A _Marina Ibrishimova_, Aug 26 2016