First, I have to admit that I have already asked the same question on MSE several days ago. If I am bending any rules, I apologize for that and moderator can delete or close this question without warning. The problem has received a number of upvotes on MSE but with no suggestions or hints provided from the community.
I need to prove the following:
$$\sum_{n = 1}^{p - 1} n^{p - 1} \equiv (p - 1)! + p \pmod {p^2}$$
...with $p$ being an odd prime number. I'm pretty much sure that the statement is correct (I have tested it by computer for many values of $p$ and did not find an exception).
What puzzles me is the fact that the statement is trivial and obviously true for$\pmod p$. The left-hand side is congruent to $-1 \pmod p$ by Fermat's little theorem, and the right-hand side is also congruent to $-1 \pmod p$ by Wilson's theorem.
However, I am unable to "lift the exponent" and go from$\pmod p$ to$\pmod {p^2}$. Maybe the sum on the left could somehow be transformed using the existence of a primitive root$\pmod {p^2}$.
Thanks and happy holidays!