OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 431881 is a term because (59, 61) is a twin prime pair with 59*61*(59+61)+1 = 431881, and 431881 is prime.
MAPLE
P:= select(isprime, {seq(i, i=3..10^6, 2)}):
T:= P intersect map(`-`, P, 2):
R:= map(t -> t*(t+2)*(2*t+2)+1, T):
sort(convert(select(isprime, R), list));
MATHEMATICA
Select[#[[1]]#[[2]]Total[#]+1&/@Select[Partition[Prime[Range[1000]], 2, 1], #[[2]]-#[[1]] == 2&], PrimeQ] (* Harvey P. Dale, Aug 17 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 = p*q*(p+q)+1
if isprime(t):
yield t
p, q = q, nextprime(q)
print(list(islice(agen(), 25))) # Michael S. Branicky, Apr 19 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Apr 19 2022
STATUS
approved