TAOCP 1.2.7 Exercise 17
Since $p$ is an odd prime, the integers 1,2,\ldots,p-1 can be paired as
Section 1.2.7: Harmonic Numbers
Exercise 17. [M24] (E. Waring, 1782.) Let $p$ be an odd prime. Show that the numerator of $H_{p-1}$ is divisible by $p$.
Verified: no
Solve time: -
Solution
Since $p$ is an odd prime, the integers
$$ 1,2,\ldots,p-1 $$
can be paired as
$$ k \leftrightarrow p-k, \qquad 1 \le k \le p-1. $$
Therefore
$$ H_{p-1} = \sum_{k=1}^{p-1}\frac1k = \frac12\sum_{k=1}^{p-1}\left(\frac1k+\frac1{p-k}\right). $$
Now
$$ \frac1k+\frac1{p-k} = \frac{p}{k(p-k)}. $$
Hence
$$ H_{p-1} = \frac p2\sum_{k=1}^{p-1}\frac1{k(p-k)}. $$
The denominator of
$$ \sum_{k=1}^{p-1}\frac1{k(p-k)} $$
is relatively prime to $p$, because neither $k$ nor $p-k$ is divisible by $p$ when $1 \le k \le p-1$. Consequently this sum can be written in lowest terms as
$$ \frac ab, \qquad p \nmid b. $$
Then
$$ H_{p-1}=\frac p2\cdot\frac ab=\frac{pa}{2b}. $$
Since $p$ is odd, $\gcd(p,2b)=1$. Therefore, after reduction to lowest terms, the numerator remains divisible by $p$.
Thus the numerator of $H_{p-1}$ is divisible by $p$.
This completes the proof.
∎