OFFSET
1,1
COMMENTS
a(n) = 0 if n == 1 (mod 3) and n > 1.
Conjecture: a(n) > 0 otherwise.
LINKS
Robert Israel, Table of n, a(n) for n = 1..67
EXAMPLE
a(9) = 739 because 9^3 + 9 + 1 = 739 is prime while 9^2 + 9 + 1 is not.
MAPLE
f:= proc(n) local i;
if n mod 3 = 1 then return 0 fi;
for i from 2 do if isprime(n^i+n+1) then return n^i+n+1 fi od:
end proc:
f(1):= 3:
map(f, [$1..100]);
PROG
(Python)
from sympy import isprime
def a(n):
if n > 1 and n%3 == 1: return 0
k = 2
while not isprime(n**k + n + 1): k += 1
return n**k + n + 1
print([a(n) for n in range(1, 52)]) # Michael S. Branicky, Jul 07 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Jul 07 2021
STATUS
approved