OFFSET
1,1
COMMENTS
Primes p such that (p-1)*p+(p-1)+p and p*(p+1)+p+(p+1) are also prime.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 5 is a term because 5, 5^2+3*5+1 = 41 and 5^2+5-1 = 29 are all prime.
MAPLE
select(t -> isprime(t^2+3*t+1) and isprime(t^2+t-1), [seq(ithprime(i), i=1..10000)]);
PROG
(Python)
from itertools import islice
from sympy import isprime, nextprime
def agen():
p = 2
while True:
if isprime(p**2 + 3*p + 1) and isprime(p**2 + p - 1):
yield p
p = nextprime(p)
print(list(islice(agen(), 53))) # Michael S. Branicky, Mar 22 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Mar 22 2022
STATUS
approved