Find the sum of inverses $\bmod p$ of numbers in range $[1,\frac{p-1}{2}]$

50 Views Asked by At

Let $p$ be an odd prime. Is it possible to compute $\sum_{k=1}^{\frac{p-1}{2}}k^{-1}\bmod p$ more efficiently than in $O(p)$?

1

There are 1 best solutions below

0
On

Not really an answer, but a long comment for collecting ideas.
Using Stirling numbers of the second kind $$\sum_{k=1}^{(p-1)/2}k^{-1}\equiv \sum_{k=1}^{(p-1)/2}k^{p-2}\equiv \sum_{k=1}^{(p-1)/2}\sum_{h=0}^{p-2}{p-2 \brace h}\binom{k}{h}h!\equiv \sum_{h=0}^{p-2}{p-2 \brace h}\binom{(p+1)/2}{h+1}h!\pmod{p} $$ and there might be a useful analogue of Lucas' theorem for these Stirling numbers.
Another chance might be to define $$ P_l \equiv \sum_{k=1}^{(p-1)/2}k^l\pmod{p} $$ and infer the value of $P_{p-2}$ from $P_0=-\frac{1}{2},P_1=-\frac{1}{2^3},P_2=0,P_3=\frac{1}{2^6},P_4=0,P_5=-\frac{1}{2^7},P_6=0,P_7=\frac{17}{2^{11}}\ldots$
Here of course $\frac{1}{2}$ stands for $2^{-1}\pmod{p}$, i.e. $\frac{p+1}{2}$. Some strategies for the evaluation of Bernoulli numbers $\pmod{p}$ involve the Von Staudt-Clausen theorem and the Chinese remainder theorem.