Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Prove that for any odd prime $p$ $$ H_{p-1}=1+\frac{1}{2} + \cdots + \frac{1}{p-1} $$ contains a multiple of $p$ in the numerator when written in reduced form, i.e. $\frac{a}{b}$ where $\mathrm{gcd}(a,b)=1$.

share|cite|improve this question
I understand you're simply quoting a math problem, but without writing your own thoughts anywhere around it, or otherwise framing it in some way (e.g. blockquotes), what you've literally posted is a command to us - not polite at all. Biting the hand that feeds and so on. – anon Nov 6 '11 at 20:10
Thanks for the acceptance (within one minute of posting the answer!), but see this thread on meta… . I think the software allows un-accepting an answer and choosing later which one (if any) to accept. – zyx Nov 6 '11 at 20:36
up vote 1 down vote accepted

Because $p$ is odd, the indices in the sum can be grouped into $(p-1)/2$ pairs $\{ i , p-i \}$ and in each pair the sum is divisible by $p$.

Stronger statements mod $p^2$ and $p^3$ are known as Wolstenholme's congruences.

share|cite|improve this answer

The operation of reciprocation in $\mathbb{Z}/p \mathbb{Z}$ is a one-to-one map, thus reciprocals of all positive integers $1,2,\ldots,p-1$ would be permutations thereof. The sum of permutated numbers is the same as the sum of ordered numbers, i.e. $$ \sum_{k=1}^{p-1} \frac{1}{k} \equiv \sum_{i=1}^{p-1} i \equiv p \cdot \frac{p-1}{2} \equiv 0 \mod p $$

share|cite|improve this answer
The assumption that $p$ is odd is not used in the first sentence, but it is necessary for the last step. – zyx Nov 6 '11 at 20:45
@zyx The first sentence only uses that $p$ is prime, but the last equality follows for odd primes only. This was implied in my answer. Thanks for spelling this out. – Sasha Nov 6 '11 at 20:53
The answer is of course correct, the point was only that since the conclusion is false for $p=2$ while the first sentence is true for all $p$, it is interesting to "localize" where the difficulty with $2$ occurs (or at least, that question came to mind while reading the answer). Every line of the proof works for all $p$, except that $p(p-1)/2$ is no longer divisible by $p$ when $p=2$. – zyx Nov 7 '11 at 6:24

Write it as $$H_{p-1} = \frac{\frac{(p-1)!}{1} + \dots + \frac{(p-1)!}{p-1}}{(p-1)!}.$$ Then the denominator is not divisible by $p$, so it is enough to prove that the numerator is. Now $\mathbb{Z}_p$ is a field so we have actually $$\frac{(p-1)!}{1} + \dots + \frac{(p-1)!}{p-1} = (p-1)!(1 + \dots + (p-1)) = 1 + \dots + (p-1) = \frac{p(p-1)}{2}$$ which is $0$.

Here we have repeatedly used the fact that $\mathbb{Z}_p \setminus \{0\}$ is a group under multiplication. Taking inverses or multiplying by a group element are bijective operations.

share|cite|improve this answer
@zyx: Thanks. I was writing the answer a bit hastily, and Wilson's theorem just appeared to me for some reason. Edited. – J. J. Nov 6 '11 at 20:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.