TITLE: Prove that $\sum_{n = 1}^{p - 1} n^{p - 1} \equiv (p - 1)! + p \pmod {p^2}$ with $p$ being an odd prime
QUESTION [12 upvotes]: 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!

REPLY [3 votes]: One may also use the fundamental theorem of symmetric polynomials applied to the polynomial $f(x_1,\dots,x_{p-1})=x_1^{p-1}+\dots+x_{p-1}^{p-1}+(p-1)x_1\dots x_{p-1}\in \mathbb{Z}[x_1,\dots,x_{p-1}]$. Suppose $f=g(\sigma_1,\dots,\sigma_{p-1})$, where $\sigma_i$'s are elementary symmetric polynomials, and $g$ is a polynomial with integer coefficients. Let $\zeta$ is the $p$-th root of unity. Note that since $f(\zeta,\zeta^2,\dots,\zeta^{p-1})=0$ and all $\sigma_i$'s except for $\sigma_{p-1}$ vanish at $(\zeta,\zeta^2,\dots,\zeta^{p-1})$, there is no monomial $\sigma_{p-1}$ in $g$. It remains to note that $\sigma_i(1,2,\dots,p-1)$ is divisible by $p$ for any $i<p-1$ and so $f(1,2,\dots,p-1)$ is divisible by $p^2$ which easily implies the result.