%I #18 Dec 03 2014 00:25:55
%S 1,1,1,1,5797,272753965,8749232767,1045741078641946876220133713545
%N 1^m + 2^m + ... + m^m (mod m) for primary pseudoperfect numbers m.
%C A031971(m) (mod m) for m in A054377 = 2, 6, 42, 1806, 47058, 2214502422, 52495396602, 8490421583559688410706771261086. The known values of m for which 1^m + 2^m + ... + m^m == 1 (mod m) are m = 1, 2, 6, 42, 1806.
%C For any m and prime p | m, use Sum_{j=1..m} j^m == -m/p (mod p) if p-1 | m or == 0 (mod p) otherwise (see Lemma 3 in Grau et al.) and the Chinese Remainder Theorem.
%H J. M. Grau, A. M. Oller-Marcen, and J. Sondow, <a href="http://arxiv.org/abs/1309.7941">On the congruence 1^m + 2^m + ... + m^m == n (mod m) with n|m</a>, arXiv:1309.7941 [math.NT].
%F a(n) = 1 for n = 1, 2, 3, 4.
%e The 1st primary pseudoperfect number is 2, and 1^2 + 2^2 = 5 == 1 (mod 2), so a(1) = 1.
%t ps={2, 6, 42, 1806, 47058, 2214502422,52495396602, 8490421583559688410706771261086}; fa = FactorInteger; VonStaudt[n_] := Mod[n - Sum[If[IntegerQ[n/(fa[n][[i, 1]] - 1)], n/fa[n][[i, 1]], 0], {i, Length[fa[n]]}], n]; Table[VonStaudt[ps[[i]]], {i, 1, 8}]
%Y Cf. A031971, A054377, A231409.
%K more,nonn
%O 1,5
%A _Jonathan Sondow_, Dec 10 2013