OFFSET
1,1
COMMENTS
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
2^3-2=6-+1 = 5,7 primes, 11^3-11-+1 = 1319,1321 primes...
MATHEMATICA
lst={}; Do[p=Prime[n]; a=p^3-p; If[PrimeQ[a-1]&&PrimeQ[a+1], AppendTo[lst, p]], {n, 8!}]; lst
Select[Prime[Range[3500]], And@@PrimeQ[#^3-#+{1, -1}]&] (* Harvey P. Dale, Jan 05 2013 *)
PROG
(Python)
import sympy
from sympy import isprime
{print(p) for p in range(10**5) if isprime(p) and isprime(p**3-p-1) and isprime(p**3-p+1)} # Derek Orr, Jan 27 2014
(PARI)
s=[]; forprime(p=2, 40000, if(isprime(p^3-p-1) && isprime(p^3-p+1), s=concat(s, p))); s /* Colin Barker, Jan 28 2014 */
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Joseph Stephan Orlovsky, Mar 15 2009
STATUS
approved