Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #12 Jul 08 2021 14:21:44
%S 3,7,13,0,31,43,0,73,739,0,14653,157,0,211,241,0,307,5851,0,421,463,0,
%T 1801152661487,601,0,457003,757,0,24419,27031,0,32801,1123,0,
%U 144884079282928466796911,1679653,0,1483,59359,0,1723,74131,0,85229,8303765671,0,4879729,110641,0,2551,2334165173090503
%N a(n) is the least prime of the form n^k+n+1 with k>1, or 0 if there is no such prime.
%C a(n) = 0 if n == 1 (mod 3) and n > 1.
%C Conjecture: a(n) > 0 otherwise.
%H Robert Israel, <a href="/A346154/b346154.txt">Table of n, a(n) for n = 1..67</a>
%F a(n) = n^A346149(n) + n + 1 if A346149(n) > 0.
%e a(9) = 739 because 9^3 + 9 + 1 = 739 is prime while 9^2 + 9 + 1 is not.
%p f:= proc(n) local i;
%p if n mod 3 = 1 then return 0 fi;
%p for i from 2 do if isprime(n^i+n+1) then return n^i+n+1 fi od:
%p end proc:
%p f(1):= 3:
%p map(f, [$1..100]);
%o (Python)
%o from sympy import isprime
%o def a(n):
%o if n > 1 and n%3 == 1: return 0
%o k = 2
%o while not isprime(n**k + n + 1): k += 1
%o return n**k + n + 1
%o print([a(n) for n in range(1, 52)]) # _Michael S. Branicky_, Jul 07 2021
%Y Cf. A346149.
%K nonn
%O 1,1
%A _J. M. Bergot_ and _Robert Israel_, Jul 07 2021