TITLE: $i'=i^{-1} \bmod p$, prove or disprove that $\lim_{p\to \infty}\frac{1}{p^3}\sum_{i=1}^{p-1}ii'=\frac{1}4$
QUESTION [24 upvotes]: Let $p$ be a prime, $i'$ is the least positive integer such that $i\times i'\equiv 1\pmod p$, 
  denote $$S(p)=\sum_{i=1}^{p-1}i\times i',$$ prove or disprove that $$\lim_{p\to \infty} \frac{S(p)}{p^3}=\frac{1}4.$$


Why I believe this is true?

If $(j)=\{j_1,j_2,\cdots j_{p-1}\}$ is a rearrangement to $(i),$ where $(i)=\{1,2,\cdots p-1\},$ denote $$J=\sum_{i=1}^{p-1}i\times j_i,$$ we have 
$$\sum_{i=1}^{p-1}i(p-i)\le J \le \sum_{i=1}^{p-1}i^2$$
hence
$$\frac{1}2p^2(p-1)-\frac{1}6p(p-1)(2p-1)=\frac{1}6p(p-1)^2\le J \le \frac{1}6p(p-1)(2p-1).$$
The upper bound $\approx \dfrac{1}3p^3$ and the lower bound $\approx\dfrac{1}6p^3$.
We can prove that $E(J)=\frac{1}4p^2(p-1)$. 
If $(j)$ run over every permutation of $\{1,2,\cdots p-1\},$ then
$$E(J)=\frac{1}{(p-1)!}\sum_{(j)}\sum_{i=1}^{p-1}i\times j_i\\
=\frac{1}{(p-1)!}\sum_{i=1}^{p-1}i\times\sum_{(j)} j_i\\
=\frac{1}{(p-1)!}\sum_{i=1}^{p-1}i\sum_{k=1}^{p-1}k\times \frac{(p-1)!}{p-1}\\
=\frac{1}4p^2(p-1).$$
Similarly, we can prove that Var$(J)=\dfrac{1}2p^2(p-1),$ and $\sigma(J)=\sqrt{\dfrac{1}2p^2(p-1)},$
hence $$\lim_{p\to \infty}\frac{\sigma(J)}{E(J)}=0.$$
Since $(i')$ is a rearrangement to $(i)$ (and with no special pattern relate to the main part of that $\sum$), this leads me to believe that $S(p)\sim E(J)\sim \dfrac{1}4p^3.$

REPLY [3 votes]: For some numerical support, here's a plot of $S(p)/p^3$ for the first $4000$ primes.