OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(4) = 7 is a term because 7, 11, 13 are consecutive primes with 13*(7+11) + 7*11 = 311 and 13*(7+11) - 7*11 = 157 are prime.
MAPLE
q:= 2: r:= 3: count:= 0: R:= NULL:
while count < 100 do
p:= q; q:= r; r:= nextprime(r);
if isprime(r*(p+q)+p*q) and isprime(r*(p+q)-p*q) then
R:= R, p; count:= count+1
fi
od:
R;
MATHEMATICA
Select[Partition[Prime[Range[3500]], 3, 1], PrimeQ[(s = #[[3]]*(#[[1]] + #[[2]])) + (t = #[[1]]*#[[2]])] && PrimeQ[s - t] &][[;; , 1]] (* Amiram Eldar, Nov 13 2022 *)
PROG
(Python)
from itertools import islice
from sympy import isprime, nextprime
def agen():
p, q, r = 2, 3, 5
while True:
rpq, pq = r*(p+q), p*q
if all(isprime(t) for t in [rpq+pq, rpq-pq]): yield p
p, q, r = q, r, nextprime(r)
print(list(islice(agen(), 48))) # Michael S. Branicky, Nov 20 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Nov 12 2022
STATUS
approved