OFFSET
1,1
COMMENTS
Lower twin primes p such that if q = p+2, (p*q-1)/2 and (p*q-1)/2+p+q are also prime.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 599 is a term because it, 599+2 = 601, (599*601-1)/2 = 179999, and 179999+599+601 = 181199 are prime.
MATHEMATICA
Select[Range[200000], And @@ PrimeQ[{#, # + 2, (#^2 - 1)/2 + # , (#^2 + 3)/2 + 3*#}] &] (* Amiram Eldar, Apr 10 2022 *)
PROG
(Python)
from itertools import islice
from sympy import isprime, nextprime
def agen(): # generator of terms
p, q = 3, 5
while True:
if q == p+2 and isprime((p*q-1)//2) and isprime((p*q-1)//2+p+q):
yield p
p, q = q, nextprime(q)
print(list(islice(agen(), 42))) # Michael S. Branicky, Apr 10 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Apr 10 2022
STATUS
approved