%I #23 Dec 11 2022 15:23:49
%S 0,1,2,3,6,9,462
%N Numbers k such that k^k + k + 1 is prime.
%C There is no further term up to 10000. - _Farideh Firoozbakht_, Nov 11 2006
%C If it exists, a(8) > 32100. - _Dmitry Petukhov_, Sep 14 2021
%e a(2) = 2 because 2^2 + 2 + 1 = 7.
%t Do[ If[ PrimeQ[ n^n + n + 1], Print[n]], {n, 1, 700} ]
%t Join[{0},Select[Range[470],PrimeQ[#^#+#+1]&]] (* _Harvey P. Dale_, Dec 11 2022 *)
%o (PARI) f2(n,k) = for(x=1,n,y=x^x+x+k;if(ispseudoprime(y),print1(x","))) \\ _Cino Hilliard_, Jan 07 2005
%o (PFGW) ABC2 $a^$a + $a + 1
%o a: from 0 to 1000 // _Jinyuan Wang_, Mar 01 2020
%Y Cf. A058912 (k^k + k - 1 is prime), A161471 (corresponding primes).
%K nonn,hard,more
%O 1,3
%A _Felice Russo_, Jan 10 2001