|
|
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.
|
|
1
|
|
|
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, 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, 3, 2, 4, 6, 2, 11, 1, 2, 16, 4, 4, 2, 4, 2, 8, 1, 12, 1, 8
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,4
|
|
COMMENTS
|
The number of iterations is defined as in A050412 (probably always positive).
Sophie Germain primes correspond to values a(n)=1 (A156660).
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).
For prime(21) = 73, a(21) = 2552 corresponds to the prime 12525084203....315016703 with 771 digits. See A171390. - Vincenzo Librandi, Apr 27 2015
a(n) is the smallest k > 0 such that (prime(n) + 1)*2^k - 1 is prime. - Thomas Ordowski, Jun 05 2019
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
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.
|
|
MAPLE
|
|
|
MATHEMATICA
|
Length@ NestWhileList[2 # + 1 &, Prime@ #, CompositeQ, {2, 1}] - 1 & /@ Range@ 120 (* Michael De Vlieger, Apr 26 2015 *)
|
|
PROG
|
(PARI) genit()={
my(maxx=122, istrt=1, opt=1); n=istrt; cnt=1; val=2*prime(n)+1;
prev=val; prcnt=0; while(n<=maxx, if( val%6!=1 && val%6!=5, cnt+=1; val=2*val+1 );
if(ispseudoprime(val), print1(cnt, ", "); if(opt>0&&ispseudoprime(2*val+1), prcnt+=1);
cnt=1; n+=1; val=2*prime(n)+1; prev=val ); if(!ispseudoprime(val), cnt+=1; val=2*val+1));
}
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|