<s>[INST] Prove for primes p $>2$ that $\sum_{k=1}^{p−1}{k^{2p−1}}\equiv\frac{1}{2}p(p+1)\pmod {p^2}$ 
Let $p$ be an odd prime. Prove that:
  $$\sum_{k=1}^{p−1}{k^{2p−1}}\equiv\dfrac{p(p + 1)}{2}\pmod {p^2}$$


The problem is taken from the 2004 Canada National Olympiad.
I am only able to show that the sum is congruent to $0$ modulo $p$ (no congruence modulo $p^2$).

Since no value of $k$ is divisible by $p$, we have by Fermat's Little Theorem
$$k^{p-1}\equiv1\pmod p\implies k^{p-1}=np+1\text{ for an }n\in\mathbb{Z^+}$$
so then 
$$\begin{align}
k^{2(p-1)}=1+2np+p^2&\equiv 1+p\pmod {2p} \\
&\equiv 1\pmod p
\end{align}$$
But this does no better than $$k^{2p-1}\equiv k\quad(\mod p)$$
Hence, 
$$\begin{align}
\sum_{k=1}^{p−1}{k^{2p−1}}&\equiv\dfrac{p(p - 1)}{2}\pmod p \\
&\equiv 0\pmod p
\end{align}$$
which is trivial.
 [/INST] In general: $$(a+b)^n \equiv a^n + nba^{n-1}\pmod{b^2}.$$ Letting $a=-k, b=p, n=2p-1$, you get that $$(p-k)^{2p-1} \equiv (2p-1)pk^{2p-2} - k^{2p-1}\pmod{p^2}$$
And $k^{2p-2}=(k^2)^{p-1}\equiv 1\pmod p$, we have $$(2p-1)pk^{2p-2}\equiv -pk^{2p-2}\equiv  -p\pmod {p^2}.$$
So $$(p-k)^{2p-1} \equiv -p -k^{2p-1}\pmod{p^2}$$
So $$2\sum_{k=1}^{p-1} k^{2p-1} = \sum_{k=1}^{p-1} \left(k^{2p-1}+(p-k)^{2p-1}\right) \equiv -p(p-1)\equiv p\equiv p^2+p\pmod{p^2}$$
</s>