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

%I #42 Jul 19 2024 12:08:29

%S 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 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 3,2,4,6,2,11,1,2,16,4,4,2,4,2,8,1,12,1,8

%N 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 The number of iterations is defined as in A050412 (probably always positive).

%C Sophie Germain primes correspond to values a(n)=1 (A156660).

%C 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 For prime(21) = 73, a(21) = 2552 corresponds to the prime 12525084203....315016703 with 771 digits. See A171390. - _Vincenzo Librandi_, Apr 27 2015

%C a(n) is the smallest k > 0 such that (prime(n) + 1)*2^k - 1 is prime. - _Thomas Ordowski_, Jun 05 2019

%H Bill McEachen, <a href="/A257495/b257495.txt">Table of n, a(n) for n = 1..7075</a>, using ispseudoprime() in the Pari code.

%F a(n) = A050412(prime(n)). - _Michel Marcus_, Jun 08 2015

%e 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 := proc(n)

%p A050412(ithprime(n)) ;

%p end proc: # _R. J. Mathar_, Jul 23 2015 reusing code from A050412

%t Length@ NestWhileList[2 # + 1 &, Prime@ #, CompositeQ, {2, 1}] - 1 & /@ Range@ 120 (* _Michael De Vlieger_, Apr 26 2015 *)

%o (PARI) genit()={

%o my(maxx=122,istrt=1,opt=1);n=istrt;cnt=1;val=2*prime(n)+1;

%o prev=val;prcnt=0;while(n<=maxx, if( val%6!=1 && val%6!=5,cnt+=1;val=2*val+1 );

%o if(ispseudoprime(val), print1(cnt,",");if(opt>0&&ispseudoprime(2*val+1),prcnt+=1);

%o cnt=1;n+=1;val=2*prime(n)+1;prev=val ); if(!ispseudoprime(val),cnt+=1;val=2*val+1));

%o }

%o (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 Cf. A050412 (Riesel problem).

%K nonn

%O 1,4

%A _Bill McEachen_, Apr 26 2015