%I #38 Feb 20 2024 06:59:49
%S 2,5,6,10,30
%N Numbers n such that Sum_{k=1..n} k^k is prime.
%C Any additional terms are greater than 1320 with the next prime having more than 4120 digits.
%C No terms out to 3000. The next term would yield a prime with over 10000 digits. - John Sillcox (johnsillcox(AT)hotmail.com), Aug 05 2003
%C For every n, a(n) must be equal to 1 or 2 (mod 4) because Sum[k^k,{k,a(n)}] must be odd. Any additional terms are greater than 5368 with the next prime having more than 20025 digits. - _Farideh Firoozbakht_, Aug 09 2003
%C Soundararajan finds an asymptotic upper bound of log k / log log k prime numbers of the form 1^1 + 2^2 + ... + n^n less than k; that is, n << log a(n) / log log a(n). - _Charles R Greathouse IV_, Aug 27 2008
%C According to Andersen, the next term is larger than 28000, see Rivera link. - _M. F. Hasler_, Mar 01 2009
%C Conjecture: This sequence is infinite. - _Daniel Hoying_, Jul 20 2020
%H Carlos Rivera, <a href="http://www.primepuzzles.net/puzzles/puzz_404.htm">Puzzle 404. Sigma(x^x), for x=1 to n</a>, The Prime Puzzles & Problems Connection.
%H K. Soundararajan, <a href="https://doi.org/10.1006/jnth.1993.1020">Primes in a Sparse Sequence</a>, Journal of Number Theory 43:2 (1993), pp. 220-227.
%F log a(n) >> n log^2 n. - _Charles R Greathouse IV_, May 17 2016
%t v={}; Do[If[(Mod[n, 4]==1||Mod[n, 4]==2)&&PrimeQ[Sum[k^k, {k, n}]], v=Insert[v, n, -1]; Print[v]], {n, 5368}]
%o (PARI) s=0; for(k=1,1320, s=s+k^k; if(isprime(s), print1(k,", ")))
%Y Cf. A073826 (corresponding primes), A001923 (Sum k^k, k=1..n).
%K nonn
%O 1,1
%A _Rick L. Shepherd_, Aug 13 2002
%E Edited by _Charles R Greathouse IV_, Oct 27 2010