# $1^{-1}+2^{-1}+\dots+\Big(\frac{p-1}{2}\Big)^{-1} \equiv -\frac{2^p - 2}{p} \mod p$ for an odd prime $p.$

I've reduced a problem down to proving this identity. Unfortunately, I don't know where to even start. There has to be some way of expanding the RHS or combining terms on the LHS, but I don't see it. Any hints?

• The key idea is to start from $a^{n/2} \equiv -1 \mod p$ – zeraoulia rafik May 29 at 13:28
• @zeraouliarafik Where $n = p-1$? – Display name May 29 at 13:30
• yeah , I think it would be works try it out – zeraoulia rafik May 29 at 13:42

David W. Boyd writes:

There is a relationship between values of certain $$H_n$$ and Fermat's quotient $$q_a = {(a^{p-1}-1)}/p \bmod p$$. For example, a result from Eisenstein from 1850 [Dickson 1952, p. 41] states that $$H_{(p-1)/2} \equiv -2q_2 \mod p$$; this is easily seen from the binomial expansion of $${(1 + 1)}^p$$.

This is your hint, and if that's not enough, the reference where to find a proof.

[Dickson 1952]: L. E. Dickson, History of the Theory of Numbers.
[Boyd 1994]: David W. Boyd, A $$p$$-adic Study of the Partial Sums of the Harmonic Series.

• Thanks. The binomial expansion gives $1^{-1} - 2^{-1} + \dots + (-1)^{p-1} (p-1)^{-1},$ but this is an expression I had earlier simplified to the LHS in the title. So my solution will be even shorter than expected. – Display name May 29 at 13:48
• @Displayname I have a proof using elementary number theory. Do you want me to write? – Shubhrajit Bhattacharya May 29 at 13:51
• @ShubhrajitBhattacharya Binomial theorem and modular arithmetic is already elementary, but go ahead. I'm curious as to how you can get even simpler than expanding $((1+1)^p - 2)/p.$ – Display name May 29 at 13:57

This is not true, for example $$\text{p}=47$$. We get:

$$\sum_{\text{k}=1}^{23}\frac{1}{\text{k}}=\frac{444316699}{118982864}\tag1$$

Which is not congruent to:

$$\frac{2-2^{47}}{47}\mod{47}=-2994414645858\mod{47}=6\tag2$$

• Check again. $47$ divides $6\cdot118982864 - 444316699.$ – Display name May 29 at 13:20
• $118982864^{-1} \equiv 37 \mod 47$ and $37 \cdot 444316699 \equiv 6 \mod 47$. – orlp May 29 at 13:20
• By the way, which calculator spit out a denominator of $2^4\cdot7\cdot11\cdot13\cdot17\cdot19\cdot23$? What happened to $3$ and $5$? – Display name May 29 at 13:22
• @Displayname Those got cancelled. $$\frac{1}{5} + \frac{1}{10} + \frac{1}{15} + \frac{1}{20} = \frac{12 + 6 + 4 + 3}{60} = \frac{25}{60} = \frac{5}{12}$$ and similar but longer for the multiples of $3$. – Daniel Fischer May 29 at 13:27

This is an additional part to the given answer by @orlp, The following theorem discovred by many Authors repeatedly ( A fried -mann and J Tamarkine ,M Lerch and Nielson ], for $$p \geq3$$ and $$1\leq m \leq p-2$$

$$\sum_{j=1}^{p-1} j^m q_p(j) \equiv \frac{-B_m}{m} \bmod{p}$$, here $$q_p(j) =\frac{j^{p-1}-1}{p}$$ denote the fermat quotient and $$B_m$$ are Bernouli numbers such that $$p\nmid j$$, For reference you may check this Handbook (page 548)