%I #12 Oct 19 2014 11:48:10
%S 1429,5827,7411,9601,12601,18457,20011,20521,24919,25999,28591,29947,
%T 33211,33349,36037,38149,41227,42649,43579,45307,46099,49999,52057,
%U 52387,54319,59107,59197,59629,67891,70951,73477,74761,75037,81157,92041,93607,114889
%N Primes p such that p^4-p^3+1 and p^4-p^3-1 are also primes.
%H K. D. Bajpai, <a href="/A238136/b238136.txt">Table of n, a(n) for n = 1..2918</a>
%e 1429 is in the sequence because 1429, (1429^4-1429^3+1) and (1429^4-1429^3-1) are all primes.
%p 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);
%t Select[Prime[Range[3000]],PrimeQ[#^4-#^3+1]&&PrimeQ[#^4-#^3-1]&]
%t 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}];
%t 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 *)
%o (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
%Y Cf. A000040, A237639, A237641, A237642.
%K nonn
%O 1,1
%A _K. D. Bajpai_, Feb 18 2014