OFFSET
1,1
COMMENTS
Lower twin primes p such that if q = p+2, then (p*q-1)/2, (p*q-1)/2-p-q and (p*q-1)/2+p+q are also prime.
All terms but the first == 29 (mod 30).
LINKS
Robert Israel, Table of n, a(n) for n = 1..2500
EXAMPLE
a(3)=599 is a term because it, 599+2 = 601, (599*601-1)/2 = 179999, 179999-599-601 = 178799, and 179999+599+601 = 181199 are prime.
MAPLE
R:= 5: count:= 0:
for p from 29 by 30 while count < 60 do
if isprime(p) and isprime(p+2) then
q:= p+2; r:= (p*q-1)/2;
if isprime(r) and isprime(r+p+q) and isprime(r-p-q) then
count:= count+1; R:= R, p;
fi
fi
od:
R;
MATHEMATICA
Select[Prime[Range[250000]], And @@ PrimeQ[{# + 2, (#^2 - 5)/2 - #, (#^2 - 1)/2 + #, (#^2 + 3)/2 + 3*#}] &] (* Amiram Eldar, Apr 11 2022 *)
Select[Prime[Range[260000]], AllTrue[{#+2, (#^2-5)/2-#, (#^2-1)/2+#, (#^2+3)/2+3#}, PrimeQ]&] (* Harvey P. Dale, Jun 12 2024 *)
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:
t, s = (p*q-1)//2, p+q
if isprime(t) and isprime(t+s) and isprime(t-s):
yield p
p, q = q, nextprime(q)
print(list(islice(agen(), 36))) # Michael S. Branicky, Apr 10 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Apr 10 2022
STATUS
approved