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.

A329727 Numbers k such that k^3 +- 2 and k +- 2 are prime.

Original entry on oeis.org

129, 1491, 1875, 2709, 5655, 6969, 10335, 14325, 14421, 17319, 26559, 35109, 37509, 43719, 50229, 52629, 101871, 102795, 104325, 105501, 120429, 127599, 132699, 136395, 137829, 157521, 172425, 173685, 179481, 186189, 191829, 211371, 219681, 221199, 229215, 234195
Offset: 1

Views

Author

K. D. Bajpai, Nov 19 2019

Keywords

Comments

All terms in this sequence are divisible by 3.

Examples

			a(1) = 129:
  129^3 + 2 = 2146691;
  129^3 - 2 = 2146687;
  129   + 2 =     131;
  129   - 2 =     127; all four results are prime.
a(2) = 1491:
  1491^3 + 2 = 3314613773;
  1491^3 - 2 = 3314613769;
  1491   + 2 =       1493;
  1491   - 2 =       1489; all four results are prime.
		

Crossrefs

Intersection of A038599, A067200, and A087679.

Programs

  • Magma
    [k:k in [1..250000]|forall{m:m in [-2,2]|IsPrime(k+m) and IsPrime(k^3+m)}]; // Marius A. Burtea, Nov 20 2019
    
  • Mathematica
    Select[Range[500000], PrimeQ[#^3 + 2] && PrimeQ[#^3 - 2] && PrimeQ[# + 2] && PrimeQ[# - 2] &]
  • PARI
    isok(k) = isprime(k-2) && isprime(k+2) && isprime(k^3-2) && isprime(k^3+2); \\ Michel Marcus, Nov 24 2019
    
  • PARI
    list(lim)=my(v=List(),p=127,k); forprime(q=131,lim+2,if(q-p==4 && isprime((k=p+2)^3-2) && isprime(k^3+2), listput(v,k)); p=q); Vec(v) \\ Charles R Greathouse IV, May 06 2020