OFFSET
1,1
COMMENTS
Since x^2 + 2 is divisible by 3 unless x is divisible by 3, all elements are 3 mod 6.
REFERENCES
David Wells, Prime Numbers, John Wiley and Sons, 2005, p. 219 (article:'Siamese primes')
LINKS
Nathaniel Johnston, Table of n, a(n) for n = 1..8750
Raymond A. Beauregard and E. R. Suryanarayan, Square-plus-two primes, Mathematical Gazette 85(502) 90-1.
EXAMPLE
21 is on the list since 21^2 - 2 = 439 and 21^2 + 2 = 443 are primes.
MAPLE
select(n -> isprime(n^2-2) and isprime(n^2+2), [seq(6*i+3, i=0..1000)]); # Robert Israel, Sep 11 2014
MATHEMATICA
Select[Range[5000], PrimeQ[#^2 - 2] && PrimeQ[#^2 + 2] &] (* Alonso del Arte, Sep 11 2014 *)
PROG
(Magma) [n: n in [3..3600 by 6] | IsPrime(n^2-2) and IsPrime(n^2+2)]; // Bruno Berselli, Apr 15 2011
(PARI) is(n)=isprime(n^2-2)&&isprime(n^2+2) \\ Charles R Greathouse IV, Jul 02 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
John L. Drost, Jun 19 2005
EXTENSIONS
Terms corrected by Charles R Greathouse IV, Sep 11 2014
STATUS
approved