OFFSET
0,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
FORMULA
MATHEMATICA
Join[{2, 2}, Table[Max[Nearest[{NextPrime[2^n, -1], NextPrime[2^n]}, 2^n]], {n, 2, 40}]] (* Harvey P. Dale, Feb 19 2023 *)
PROG
(Python)
from sympy import prevprime, nextprime
def A356434(n): return (r if (m:=nextprime(k:=1<<n)) > (k<<1)-(r:=prevprime(k)) else m) if n>1 else 2 # Chai Wah Wu, Aug 08 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Munn, Aug 07 2022
STATUS
approved