

A245441


a(1)=3, then a(n) = smallest odd k > Ceiling(a(n1)/2) such that k*2^n1 is prime.


2



3, 3, 3, 3, 7, 17, 13, 27, 25, 15, 25, 23, 21, 15, 9, 17, 15, 21, 51, 35, 19, 33, 25, 39, 57, 57, 81, 45, 45, 213, 111, 57, 31, 131, 99, 83, 45, 27, 25, 107, 55, 33, 33, 35, 67, 141, 91, 89, 69, 41, 129, 89, 147, 101, 195, 129, 79, 77, 45, 77, 69, 53, 61
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


COMMENTS

A126715(n) = smallest odd k such that k*2^n1 is prime, the primes are not always in increasing order.
Here the primes k*2^n1 are always in increasing order.
The ratio sum_{1..N}a(n)/sum_{1..N}n is near 2*log(2) as N increases.
The ratio a(n)/n is always < 8 for n from 1 to 6000.


LINKS

Pierre CAMI, Table of n, a(n) for n = 1..6000


EXAMPLE

3*2^11 = 5 is prime, a(1)=3 by definition.
3*2^21 = 11 is prime, 3 > 3/2 so a(2) = 3.
3*2^31 = 23 is prime, so a(3) = 3.
3*2^41 = 47 is prime, so a(4) = 3.
3*2^51 = 95 is composite.
5*2^51 = 159 is composite.
7*2^51 = 223 is prime so a(5) = 7.


PROG

(PFGW & SCRIPT)
SCRIPT
DIM j, 1
DIM n, 0
DIMS t
OPENFILEOUT myf, a(n).txt
LABEL loop1
SET n, n+1
IF n>6000 THEN END
LABEL loop2
SET j, j+2
SETS t, %d, %d\,; n; j
PRP j*2^n1, t
IF ISPRP THEN GOTO a
GOTO loop2
LABEL a
WRITE myf, t
SET j, j/2
IF j%2==0 THEN SET j, j+1
GOTO loop1
(PARI) a=[3]; for(n=2, 100, k=floor(a[n1]/2)+2; if(k%2==0, k++); t=2^n; while(!isprime(k*t1), k+=2); a=concat(a, k)); a \\ Colin Barker, Jul 22 2014


CROSSREFS

Cf. A126715.
Sequence in context: A242715 A078229 A222292 * A333793 A007428 A184099
Adjacent sequences: A245438 A245439 A245440 * A245442 A245443 A245444


KEYWORD

nonn


AUTHOR

Pierre CAMI, Jul 22 2014


STATUS

approved



