OFFSET
0,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 0..200
EXAMPLE
a(0) = 5 because prime 5 > 2^0 = 1 and none of 5 - 2^0 = 4, 5 + 2^0 = 6 are prime,
a(1) = 23 because prime 23 > 2^1 = 2 and none of 23 - 2^2 = 22, 23 + 2^0 = 24, 23 - 2^1 = 21, 23 + 2^1 = 25 are prime,
a(2) = 53 because prime 53 > 2^2 = 4 and none of 53 - 2^0 = 52, 53 + 2^0 = 54, 53 - 2^1 = 51, 53 + 2^1 = 55, 53 - 2^2 = 49, 53 + 2^2 = 57 are prime.
MATHEMATICA
Table[p = NextPrime[2^n]; While[AnyTrue[p + Flatten@ Map[2^Range[0, n] # &, {-1, 1}], PrimeQ], p = NextPrime@ p]; p, {n, 0, 32}] (* Michael De Vlieger, Jun 27 2017 *)
PROG
(PARI) a(n)=if(n<1, return(5)); forprime(p=2^n+1, , for(k=1, n, if(isprime(p+2^k) || isprime(p-2^k), next(2))); return(p)) \\ Charles R Greathouse IV, Jul 07 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Jun 26 2017
EXTENSIONS
More terms from Michael De Vlieger, Jun 27 2017
a(15) corrected by Charles R Greathouse IV, Jul 07 2017
STATUS
approved