cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A189051 Numbers n such that n+/-2 and n^2+/-2 are all primes.

Original entry on oeis.org

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
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 16 2011

Keywords

Crossrefs

Programs

  • 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
  • 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 *)
  • PARI
    forstep(n=3,100000,6,if(isprime(n-2)&isprime(n+2)&isprime(n^2-2)&isprime(n^2+2),print1(n", ")))
    

Formula

Intersection of A087679 and A108701.

Extensions

Corrected and extended by Franklin T. Adams-Watters, Apr 16 2011