login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A189051 Numbers n such that n+/-2 and n^2+/-2 are all primes. 2
9, 15, 21, 309, 441, 1611, 2955, 3081, 3879, 5529, 7209, 7755, 7875, 13761, 15015, 15729, 16659, 21561, 22155, 35595, 37059, 38199, 45291, 50049, 51429, 59619, 63855, 67215, 67941, 71331, 72891, 83061, 96459, 96909, 102795, 106959, 111495 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
FORMULA
Intersection of A087679 and A108701.
MAPLE
select(n -> isprime(n-2) and isprime(n+2) and isprime(n^2-2) and isprime(n^2+2),
[seq(i, i=3..10^6, 6)]); # Robert Israel, Jun 23 2017
MATHEMATICA
pQ[n_]:=Module[{n2=n^2}, And@@PrimeQ[{n+2, n-2, n2+2, n2-2}]]; Select[Range[ 120000], pQ] (* Harvey P. Dale, Jun 04 2011 *)
PROG
(PARI) forstep(n=3, 100000, 6, if(isprime(n-2)&isprime(n+2)&isprime(n^2-2)&isprime(n^2+2), print1(n", ")))
(Magma) [n: n in [1..2000000]|IsPrime(n-2)and IsPrime(n+2)and IsPrime(n^2-2)and IsPrime(n^2+2)]; // Vincenzo Librandi, Apr 20 2011
CROSSREFS
Sequence in context: A125215 A102739 A124622 * A374933 A274288 A172292
KEYWORD
nonn
AUTHOR
EXTENSIONS
Corrected and extended by Franklin T. Adams-Watters, Apr 16 2011
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 6 22:26 EDT 2024. Contains 375728 sequences. (Running on oeis4.)