OFFSET
1,2
COMMENTS
k^6 + 2 is also prime for k = 4995825, 11038071, ...
a(2) = 909 = A245510(6); a(10) = 4996825, the first k such that k^6 + 2 is also prime, is A245510(7). - Jon E. Schoenfield, Dec 24 2022
FORMULA
a(n) == 3 (mod 6) for n>1. - Alexandru Petrescu, Dec 24 2022
MATHEMATICA
Select[Range[16000000], And@@PrimeQ/@(Table[n^i+2, {i, 1, 5}]/.n->#)&]
Select[Range[16*10^6], AllTrue[2 + #^Range[5], PrimeQ] &] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jun 24 2015 *)
PROG
(Python)
from sympy import isprime
def ok(n): return all(isprime(n**i+2) for i in range(1, 6))
print([k for k in range(1, 2*10**7, 2) if ok(k)]) # Michael S. Branicky, Dec 24 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Sep 20 2012
STATUS
approved