OFFSET
1,1
MATHEMATICA
sp = {}; sq = {}; Do[p = Prime[k]; q = NextPrime[p];
If[PrimeQ[4*p + q], AppendTo[sp, k]];
If[PrimeQ[4*q + p], AppendTo[sq, k]], {k, 10000}]; Intersection[sp, sq]
PROG
(Python)
from itertools import islice
from sympy import isprime, nextprime
def agen(): # generator of terms
k, p, q = 1, 2, 3
while True:
if isprime(4*p+q) and isprime(4*q+p):
yield k
k, p, q = k+1, q, nextprime(q)
print(list(islice(agen(), 60))) # Michael S. Branicky, Jun 03 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Jun 03 2022
STATUS
approved