OFFSET
1,1
COMMENTS
The only prime in this sequence is a(1) = 3.
EXAMPLE
1365^2 + 1365 + 1 = 1864591,
1365^2 + 1365 - 1 = 1864589,
1365^2 - 1365 + 1 = 1861861, and
1365^2 - 1365 - 1 = 1861859 are all prime, so 1365 is a term of this sequence.
MAPLE
q:= k-> andmap(isprime, [seq(seq(k^2+i+j, j=[k, -k]), i=[1, -1])]):
select(q, [3*t$t=1..200000])[]; # Alois P. Heinz, Feb 25 2020
MATHEMATICA
Select[Range[568000], AllTrue[Flatten[{#^2+#+{1, -1}, #^2-#+{1, -1}}, 1], PrimeQ]&] (* Harvey P. Dale, Jul 31 2022 *)
PROG
(Python)
import sympy
from sympy import isprime
{print(p) for p in range(10**6) if isprime(p**2+p+1) and isprime(p**2-p+1) and isprime(p**2+p-1) and isprime(p**2-p-1)}
CROSSREFS
KEYWORD
nonn
AUTHOR
Derek Orr, Jan 18 2014
STATUS
approved