Solution 1:

The group theoretic proof on Wikipedia is good.

Alternatively, another nice way is, the second line is working in $\mathbb{Z}/p\mathbb{Z}$,

$$ \frac2p\sum_{n=1}^{p-1} \frac{1}{n} = \frac2p \sum_{n=1}^{(p-1)/2} \frac{1}{n} + \frac{1}{p-n} = 2 \sum_{n=1}^{(p-1)/2} \frac{1}{n(p - n)}$$ $$ \equiv -\sum_{n=1}^{p-1} \frac{1}{n^2} \equiv - \sum_{n=1}^{p-1} n^2 \equiv -\frac{(p-1)p(2p - 1)}{6}$$

which appears in this article by Christian Aebi and Grant Cairns.

A more hands-on approach can be found in these notes by Timothy Choi.

Finally, an excellent survey and additional results here by Romeo Mestrovic.

Solution 2:

$ (1 + \frac 1 {p-1}) + (\frac 1 2 + \frac 1 {p-2}) + \ldots + (\frac 1 {(p-1)/2} + \frac 1 {(p+1)/2}) = \frac p {p-1} + \frac p {2(p-2)} + \ldots + \frac p {((p-1)(p+1)/4)} \\ = p \sum_{k=1}^{(p-1)/2} \frac 1 {k(p-k)} = \frac p 2 \sum_{k=1}^{p-1} \frac 1 {k(p-k)} $.

Now, working on this second sum in the field $\Bbb Z / p \Bbb Z$, and assuming $p>3$ you get :

$\sum_{k=1}^{p-1} \frac 1 {k(p-k)} = - \sum_{k=1}^{p-1} \frac 1 {k^2} = - \sum_{k=1}^{p-1} k^2 = -(p-1)p(2p-1)/6 = 0$.

If you don't know the sum of the first consecutive squares formula, you can still get it with a bit more work :

Pick a number $a \neq 1$ such that $a$ is a square modulo $p$ (again assuming $p>3$). Then, $\sum k^2 (1-a) = \sum k^2 - \sum (ak^2) = \sum k^2 - \sum k^2 = 0$. Since $1-a \neq 0$, $\sum k^2 = 0$.

(when $p = 3$, $1+ \frac 1 2 = \frac 3 2$ which is not a multiple of $3^2$)

Solution 3:

Note that $\displaystyle \sum_{1 \le i \le p-1}\dfrac{1}{i}=\displaystyle \sum_{1 \le i \le \frac{p-1}{2}}\left ( \dfrac{1}{i}+\dfrac{1}{p-i} \right )=p \displaystyle \sum_{1 \le i \le \frac{p-1}{2}}\dfrac{1}{i(p-i)}=p \cdot \dfrac{a}{b}$. Thus, enough to show that $a \equiv 0 \mod p$ or, equivalently, that integer

$$S=\displaystyle \sum_{1 \le i \le \frac{p-1}{2}}\dfrac{(p-1)!}{i(p-i)}$$

is a multiple of $p$. Let $r_i \in \mathbb{Z}_p$ st $ir_i \equiv 1 \mod p$. Note que $r_{p-i} \equiv -r_i \mod p$. So,

$$S \equiv \displaystyle \sum_{1 \le i \le \frac{p-1}{2}}\dfrac{(p-1)!}{i(p-i)}\cdot ir_i \cdot (p-i)r_{p-i} \mod p$$ $$S \equiv \displaystyle \sum_{1 \le i \le \frac{p-1}{2}}r_i^2 \mod p$$ by Wilson's Theorem. Therefore,

$$S \equiv \displaystyle \sum_{1 \le i \le \frac{p-1}{2}}i^2 = \dfrac{p(p^2-1)}{24} \mod p$$

So, $S$ is a multiple of $p$.

Solution 4:

I second Joel's comments. The proof given by Christian Aebi and Grant Cairns, in a sense, is misleading & harmful. Directly jumping into $\mathbb{Z}/p\mathbb{Z}$ without carefully observing suitability and justification is misleading and wrong. For example, when computing in $\mathbb{Z}/p\mathbb{Z}$, let $p=5$, then $\frac{1}{2} + \frac{1}{3}\equiv 3 + 2 \equiv0,$ but the numerator $mod\ 25$ is 5.

The original problem asks to prove the numerator $mod\ p^2$ is zero. One needs to be very careful when using $\mathbb{Z}/p\mathbb{Z}.$ For example, $\frac{3}{7} + \frac{1}{13}$'s numerator $mod\ 17$ is 12. But if calculating in $\mathbb{Z}/p\mathbb{Z}$ for $p=17$, one gets $\frac{1}{7}\equiv5, \frac{1}{13}\equiv4$ and $\frac{3}{7} + \frac{1}{13}\equiv2$. One can use $\mathbb{Z}/p\mathbb{Z}$ when handling $\sum_{k=1}^{(p-1)/2}\frac{1}{r(p-r)}$ is due to the guarantee of Wilson's theorem in the background, and the fact that we only care about if the modulus result is zero.