login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A256787
Smallest odd number k such that k*2^(2*n+1)+1 is a prime number.
4
1, 5, 3, 5, 15, 9, 5, 5, 9, 11, 11, 45, 5, 15, 23, 35, 9, 59, 15, 5, 3, 9, 35, 27, 23, 17, 51, 5, 29, 27, 53, 9, 9, 9, 23, 39, 23, 5, 29, 249, 9, 51, 5, 75, 51, 117, 29, 77, 131, 219, 221, 29, 53, 105, 321, 95, 179, 197, 101, 51, 81, 101, 11, 5, 21, 221, 53
OFFSET
0,2
COMMENTS
As N increases, (Sum_{n=1..N} a(n))/(Sum_{n=1..N} n) appears to tend to log(2), as can be seen by plotting the first 10000 terms.
This observation is consistent with the prime number theorem as the probability that k*2^n+1 is prime is 1/(n*log(2)+log(k)) so ~ 1/(n*log(2)) as n increases, if k ~ n*log(2) then k/(n*log(2)) ~ 1.
EXAMPLE
1*2^(2*0+1)+1=3 is prime, so a(0)=1.
1*2^(2*1+1)+1=9 and 3*2^(2*1+1)+1=25 are composite, 5*2^(2*1+1)+1=41 is prime, so a(1)=5.
MAPLE
for n from 0 to 100 do
R:= 2^(2*n+1);
for k from 1 by 2 do
if isprime(k*R+1) then A[n]:= k; break fi
od:
od:
seq(A[n], n=0..100); # Robert Israel, Apr 24 2015
MATHEMATICA
f[n_] := Block[{g, i, k}, g[x_, y_] := y*2^(2*x + 1) + 1; Reap@ For[i = 0, i <= n, i++, k = 1; While[Nand[PrimeQ[g[i, k]] == True, OddQ@ k], k++]; Sow@ k] // Flatten // Rest]; f@ 66 (* Michael De Vlieger, Apr 18 2015 *)
PROG
(PFGW & SCRIPT)
SCRIPT
DIM i
DIM n, -1
DIMS t
OPENFILEOUT myf, a(n).txt
LABEL loop1
SET n, n+2
SET i, -1
LABEL loop2
SET i, i+2
SETS t, %d, %d\,; n; i
PRP i*2^n+1, t
IF ISPRP THEN GOTO a
GOTO loop2
LABEL a
WRITE myf, t
GOTO loop1
(PARI) vector(100, n, n--; k=1; while(!isprime(k*2^(2*n+1)+1), k+=2); k) \\ Colin Barker, Apr 10 2015
CROSSREFS
Sequence in context: A128008 A265800 A144386 * A265782 A073685 A019212
KEYWORD
nonn
AUTHOR
Pierre CAMI, Apr 10 2015
STATUS
approved