OFFSET
1,5
COMMENTS
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.
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.
LINKS
J. M. Grau, A. M. Oller-Marcen, and J. Sondow, On the congruence 1^m + 2^m + ... + m^m == n (mod m) with n|m, arXiv:1309.7941 [math.NT].
FORMULA
a(n) = 1 for n = 1, 2, 3, 4.
EXAMPLE
The 1st primary pseudoperfect number is 2, and 1^2 + 2^2 = 5 == 1 (mod 2), so a(1) = 1.
MATHEMATICA
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}]
CROSSREFS
KEYWORD
more,nonn
AUTHOR
Jonathan Sondow, Dec 10 2013
STATUS
approved