OFFSET
1,1
LINKS
K. D. Bajpai, Table of n, a(n) for n = 1..2918
EXAMPLE
1429 is in the sequence because 1429, (1429^4-1429^3+1) and (1429^4-1429^3-1) are all primes.
MAPLE
KD := proc() local a, b, d; a:=ithprime(n); b:= a^4-a^3+1; d:=a^4-a^3-1; if isprime (b) and isprime(d) then RETURN (a); fi; end: seq(KD(), n=1..20000);
MATHEMATICA
Select[Prime[Range[3000]], PrimeQ[#^4-#^3+1]&&PrimeQ[#^4-#^3-1]&]
c=0; a=2; Do[k=Prime[n]; If[PrimeQ[k^4-k^3+1] &&PrimeQ[k^4-k^3-1], c=c+1; Print[c, " ", k]], {n, 1, 2000000}];
pQ[n_]:=Module[{c=n^4-n^3}, AllTrue[c+{1, -1}, PrimeQ]]; Select[Prime[ Range[ 11000]], pQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Oct 19 2014 *)
PROG
(PARI) s=[]; forprime(p=2, 120000, if(isprime(p^4-p^3+1) && isprime(p^4-p^3-1), s=concat(s, p))); s \\ Colin Barker, Feb 18 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
K. D. Bajpai, Feb 18 2014
STATUS
approved