OFFSET
1,2
PROG
(Python)
from itertools import count, islice
from sympy import isprime, nextprime, prime
def agen():
pn = 2; record = 1; yield 1
for n in count(2):
k, pn = 2, nextprime(pn)
while not isprime(pn + k*k): k += 2
if k > record: record = k; yield n
print(list(islice(agen(), 20))) # Michael S. Branicky, Nov 11 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Klaus Brockhaus, Apr 09 2007
EXTENSIONS
a(27)-a(33) from Donovan Johnson, Dec 09 2008
a(34)-a(35) from Michael S. Branicky, Nov 11 2022
STATUS
approved