MODBasic Challenging

Problem - 4219

Let $p$ be a prime and $$\frac{a}{b}=\frac{1}{1^2}+\frac{1}{2^2}+\cdots + \frac{1}{(p-1)^2}$$

where $a$ and $b$ are two co-prime positive integers. Show that $p\mid a$.


Multiplying both sides by $\left((p-1)!\right)^2$ yields $$\left((p-1)!\right)^2\cdot\frac{a}{b}=\left(\frac{(p-1)!}{1}\right)^2+\left(\frac{(p-1)!}{2}\right)^2+\cdot + \left(\frac{(p-1)!}{p-1}\right)^2$$

Every term on the right side is an integer, therefore the left side must be an integer too.

We are gong to show that the right side is a multiple of $p$. If so, the left side must be a multiple of $p$ too. However, because $p$ is a prime, we must have $p mid (p-1)!$. This will lead to the desired result $p\mid a$.

Because $p$ is a prime, for every integer $k = 1$, $2$, $\cdots$, $(p-1)$, there exists a multiplicative inverse $h$ such that $kh\equiv 1\pmod{p}$. Hence, for every $k$: $$\frac{(p-1)!}{k}\cdot (hk)\equiv (p-1)!\cdot h \pmod{p}$$

Because $1$, $2$, $\cdots$, and $(p-1)$ are all distinct, their corresponding inverses are also distinct which means that these inverses are $1$, $2$, $\cdots$, and $(p-1)$ too. $$\begin{array}{ll} \therefore & \displaystyle\sum_{k=1}^{p-1}\left(\frac{(p-1)!}{k}\right)^2\\ \equiv &  \displaystyle\sum_{k=1}^{p-1}\left(\frac{(p-1)!}{k}\cdot (hk)\right)^2 \\ \equiv &  \displaystyle\sum_{k=1}^{p-1}\left((p-1)!\cdot h\right)^2 \\ \equiv & ((p-1)!)^2\displaystyle\sum_{k=1}^{p-1} h^2 \\ \equiv & ((p-1)!)^2\cdot\frac{1}{6}\cdot (p-1)p(2(p-1)+1)\\ \equiv & 0 \pmod{p} \end{array}$$

report an error