OFFSET
0,1
LINKS
Robert Israel, Table of n, a(n) for n = 0..1000
FORMULA
Apparently a(n) = (A111671(n) - 1)/2 for n>=2. - Hugo Pfoertner, Dec 13 2023
EXAMPLE
For n = 0, a(0) = 2 because 2 is prime, 2*(2) + 1 = 5 is prime, 2 >= 2^0 where 2^0 = 1, and 1 is not prime.
For n = 1, a(1) = 2 because 2 is prime, 2*(2) + 1 = 5 is prime, 2 >= 2^1 where 2^1 = 2.
For n = 2, a(2) = 5 because 5 is prime, 2*(5) + 1 = 11 is prime, 5 >= 2^2 where 2^2 = 4, and 4 is not prime.
MAPLE
a:= proc(n) option remember; local p; for p from 2^n
while not andmap(isprime, [p, 2*p+1]) do od; p
end:
seq(a(n), n=0..44); # Alois P. Heinz, Dec 13 2023
MATHEMATICA
a={}; nmax=35; For[n=0, n<=nmax, n++, k=2^n; While[!PrimeQ[k] || !PrimeQ[2k+1], k++]; AppendTo[a, k]]; a (* Stefano Spezia, Dec 10 2023 *)
PROG
(PARI) a(n) = forprime(p=2^n, , if (isprime(2*p+1), return(p))); \\ Michel Marcus, Dec 12 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Andrei Lapets, Dec 06 2023
STATUS
approved