cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A257495 The number of iterations (x -> 2x+1) until a prime is found, starting with prime(n); or 0 if a prime is never found.

This page as a plain text file.
%I A257495 #42 Jul 19 2024 12:08:29
%S A257495 1,1,1,2,1,4,2,2,1,1,2,2,1,24,2,1,2,4,2,4,2552,4,1,1,4,8,4,2,2,1,6,1,
%T A257495 3,4,2,2,2,8,4,1,1,2,1,8,3,6,4,4,2,2,1,1,2,1,2,3,8,2,4,1,12,1,2,21,4,
%U A257495 3,2,4,6,2,11,1,2,16,4,4,2,4,2,8,1,12,1,8
%N A257495 The number of iterations (x -> 2x+1) until a prime is found, starting with prime(n); or 0 if a prime is never found.
%C A257495 The number of iterations is defined as in A050412 (probably always positive).
%C A257495 Sophie Germain primes correspond to values a(n)=1 (A156660).
%C A257495 The plot without largest outliers allows detail on lower bound trending. Such outliers begin beyond the 121st entry. The number of terminal primes (those from the terminating iteration) being Sophie Germain through the first 10000 seeds is approximately 910. The number of Sophie Germain primes expected below 10000 is approximately 156 (computationally the comparison is more complicated, obviously).
%C A257495 For prime(21) = 73, a(21) = 2552 corresponds to the prime 12525084203....315016703 with 771 digits. See A171390. - _Vincenzo Librandi_, Apr 27 2015
%C A257495 a(n) is the smallest k > 0 such that (prime(n) + 1)*2^k - 1 is prime. - _Thomas Ordowski_, Jun 05 2019
%H A257495 Bill McEachen, <a href="/A257495/b257495.txt">Table of n, a(n) for n = 1..7075</a>, using ispseudoprime() in the Pari code.
%F A257495 a(n) = A050412(prime(n)). - _Michel Marcus_, Jun 08 2015
%e A257495 Starting from prime(6)=13, sequential values for evaluation are 2*13+1=27, 2*27+1=55, 2*55+1=111, 2*111+1=223. The first prime is encountered at the 4th iteration, thus a(6)=4.
%p A257495 A257495 := proc(n)
%p A257495     A050412(ithprime(n)) ;
%p A257495 end proc: # _R. J. Mathar_, Jul 23 2015 reusing code from A050412
%t A257495 Length@ NestWhileList[2 # + 1 &, Prime@ #, CompositeQ, {2, 1}] - 1 & /@ Range@ 120 (* _Michael De Vlieger_, Apr 26 2015 *)
%o A257495 (PARI) genit()={
%o A257495 my(maxx=122,istrt=1,opt=1);n=istrt;cnt=1;val=2*prime(n)+1;
%o A257495 prev=val;prcnt=0;while(n<=maxx, if( val%6!=1 && val%6!=5,cnt+=1;val=2*val+1 );
%o A257495 if(ispseudoprime(val), print1(cnt,",");if(opt>0&&ispseudoprime(2*val+1),prcnt+=1);
%o A257495 cnt=1;n+=1;val=2*prime(n)+1;prev=val ); if(!ispseudoprime(val),cnt+=1;val=2*val+1));
%o A257495 }
%o A257495 (PARI) a(n,k=prime(n))=my(t=1);while(!ispseudoprime(k=2*k+1),t++);t \\ _Charles R Greathouse IV_, May 22 2015
%Y A257495 Cf. A050412 (Riesel problem).
%K A257495 nonn
%O A257495 1,4
%A A257495 _Bill McEachen_, Apr 26 2015