%I #20 Oct 09 2022 17:18:19
%S 5,2,3,3413,50069,8089,487,2099,10405071317,1274641129,164496735539,
%T 3514531963,15624709,23747111,10343539,56429700667,
%U 1931869473647715169,2383792821710269,144326697012150473,2053857208873393249,128801386946535261205906957,2298815880166789
%N Greatest prime divisor of 1 + 2^2 + 3^3 + ... + n^n.
%H Amiram Eldar, <a href="/A214662/b214662.txt">Table of n, a(n) for n = 2..73</a>
%F a(n) = A006530(A001923(n)).
%e a(2) = 5 divides 1 + 2^2 ;
%e a(3) = 2 divides 1 + 2^2 + 3^3 = 32 ;
%e a(4) = 3 divides 1 + 2^2 + 3^3 + 4^4 = 288 = 2^5*3^2 ;
%e a(5) = 3413 divides 1 + 2^2 + 3^3 + 4^4 + 5^5 = 3413.
%e a(13) = 3514531963 divides 1 + 2^2 + 3^3 + ... + 13^13 = 88799 * 3514531963.
%p with (numtheory):
%p s:= proc(n) option remember; `if`(n=1, 1, s(n-1)+n^n) end:
%p a:= n-> max(factorset(s(n))[]):
%p seq (a(n), n=2..23); # _Alois P. Heinz_, Jul 24 2012
%t s = 1; Table[s = s + n^n; FactorInteger[s][[-1, 1]], {n, 2, 24}] (* _T. D. Noe_, Jul 25 2012 *)
%t Module[{nn=30,lst},lst=Table[n^n,{n,nn}];Table[FactorInteger[Total[Take[lst,k]]][[-1,1]],{k,2,nn}]] (* _Harvey P. Dale_, Oct 09 2022 *)
%o (PARI) a(n) = vecmax(factor(sum(k=1, n, k^k))[,1]); \\ _Michel Marcus_, Feb 09 2020
%o (Magma) [Max(PrimeDivisors(&+[k^k:k in [1..n]])):n in [2..23]]; // _Marius A. Burtea_, Feb 09 2020
%Y Cf. A001923, A006530, A073826, A122166, A175232.
%K nonn
%O 2,1
%A _Michel Lagneau_, Jul 24 2012