OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(1) = 2 is prime; 3 is the next prime: 2^3*3^3 + 2^2 + 3^2 = 8*27 + 4 + 9 = 229 that is a prime.
a(2) = 11 is prime; 13 is the next prime: 11^3*13^3 + 11^2 + 13^2 = 1331*2197 + 121 + 169 = 2924497 that is a prime.
MAPLE
select(p -> andmap(isprime, [p, (p^3*nextprime(p)^3+p^2+nextprime(p)^2)]), [seq(p, p=1..10^4)]);
MATHEMATICA
Select[Prime[Range[5000]], PrimeQ[#^3*NextPrime[#]^3 + #^2 + NextPrime[#]^2] &]
Select[Partition[Prime[Range[1000]], 2, 1], PrimeQ[#[[1]]^3 #[[2]]^3+#[[1]]^2+#[[2]]^2]&][[;; , 1]] (* Harvey P. Dale, Sep 11 2023 *)
PROG
(PARI) forprime(p=1, 5000, q=nextprime(p+1); p3=p^3; p2=p^2; q3=q^3; q2=q^2; if(ispseudoprime(p3*q3 + p2 + q2), print1(p, ", ")));
(Magma) [p: p in PrimesUpTo(5000) | IsPrime(p^3*q^3 + p^2 + q^2) where q is NextPrime(p)];
CROSSREFS
KEYWORD
nonn
AUTHOR
K. D. Bajpai, Aug 24 2017
STATUS
approved