# A proof of Wolstenholme's theorem

This was inspired by this question. I tried to use the identity

$${2n \choose n}=\sum_{k=0}^n {n \choose k}^2$$

(see this question) to prove that $$\binom{2p}p\equiv2\pmod{p^3}$$ if $p\gt3$ is prime. (Wikipedia gives a combinatorial proof that this special case of Wolstenholme's theorem implies the general case.) Since $\binom p0=\binom pp=1$, we want

$$\sum_{k=1}^{p-1}\binom pk^2\equiv0\pmod{p^3}\;.$$

The binomial coefficients are all divisible by $p$, so we can write this as

$$\sum_{k=1}^{p-1}\left(\frac1p\binom pk\right)^2\equiv0\pmod{p}\;.$$

But

$$\frac1p\binom pk=\frac{(p-1)\cdots(p-(k-1))}{k(k-1)\cdots1}\equiv\frac1k\frac{(-1)\cdots(-(k-1))}{(k-1)\cdots1}\equiv\pm\frac1k\pmod p\;,$$

and thus

$$\sum_{k=1}^{p-1}\left(\frac1p\binom pk\right)^2\equiv\sum_{k=1}^{p-1}\left(\pm\frac1k\right)^2\equiv\sum_{k=1}^{p-1}\left(\frac1k\right)^2\pmod{p}\;.$$

As $k$ traverses the non-zero residues $\bmod p$, so does $1/k$, so this is just twice the sum of the quadratic residues $\bmod p$, which is zero for $p\gt3$ as required.

I couldn't find this proof of Wolstenholme's theorem anywhere, so I'm wondering:

• Is there a mistake in it?
• If not, is it known?
• If not, is it relevant?

[Update:]

In the meantime I came across this paper, which does make extensive use of the sum-of-squares identity in the context of Wolstenholme's theorem, though not for proving the theorem itself.

Regarding the use of the sum over reciprocals in proving the harmonic-number version of the theorem, as in the paper linked to in Don's answer: I was aware of that use, but the main reason I thought that this alternative proof might nevertheless be of interest is that to prove the congruence for the binomial coefficient from the two congruences for the (generalized) harmonic numbers requires two sums, whereas I'm only evaluating a single sum.

• I haven't seen that proof before, but I'm not a number-theorist. You could also be more explicit and write the last sum as $\sum_{k=1}^{p-1} k^{2}$ (mod $p$), and $\sum_{k=1}^{p-1}k^{2} = \frac{(p-1)p(2p-1)}{6}$, and for $p >3,$ this is divisible by $p.$ Jul 16, 2012 at 10:52
• I discovered this proof at some point. I think it is likely to be known. I think I did not find this proof online then too. What is/are the standard proof(s)? Also, is there a way to prove this using a counting argument? Jul 23, 2013 at 5:44
• Nice one for connecting concepts of quadratic residues. I put alternative proof in this posting too. math.stackexchange.com/questions/554261/… Mar 27, 2019 at 23:03

I think your proof is fine, but you can take a peek at this paper where it is proved that the numerator of $$H(p-1):=1+\frac{1}{2}+...+\frac{1}{p-1}=\sum_{k=1}^{p-1}\frac{1}{k}$$ is divisible by $\,p^2\,\,,\,p>3$ a prime.