OFFSET
1,1
COMMENTS
All terms in this sequence are divisible by 3.
LINKS
Daniel Starodubtsev, Table of n, a(n) for n = 1..10000
EXAMPLE
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.
MATHEMATICA
Select[Range[500000], PrimeQ[#^3 + 2] && PrimeQ[#^3 - 2] && PrimeQ[# + 2] && PrimeQ[# - 2] &]
PROG
(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
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
K. D. Bajpai, Nov 19 2019
STATUS
approved