MathOverflow is a question and answer site for professional mathematicians. 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

Let p>3 be a prime. For every a=1,2,...,p-1 let x(a) be the number in {1,...,p-1} such that ax(a) is congruent to 1 mod p (its inverse mod p). Let S be the sum of ax(a)^2 and let T be the sum of x(a) (in both cases sum over all a=1,2,...,p-1). Is it true that S-2T is always divisible by p^2? I noted this by computing for small values of p and I wonder if this is a known theorem or if there is a simple proof.

share|cite|improve this question
up vote 12 down vote accepted

This follows from well-known results (although perhaps not in a totally straightforward way).

Let us write $x(a) = a^{-1} + p y(a)$, where $a^{-1}$ denotes the inverse of $a$ modulo $p^2$, and $y(a) \in \{0, \dots, p-1\}$. Then we find that $$ a x(a)^2 = a^{-1} + 2p y(a) \pmod{p^2} $$ so $$ S = \sum_{a = 1}^{p-1} a^{-1} + 2p \sum_{a = 1}^{p-1} y(a) \pmod{p^2} $$ while $$ T = \sum_{a = 1}^{p-1} a^{-1} + p \sum_{a = 1}^{p-1} y(a) \pmod{p^2}. $$

So $p^2 \mid S - 2T$ if and only if $\sum_{a = 1}^{p-1} a^{-1} = 0 \pmod {p^2}$, and this latter statement is a consequence of Wolstenholme's theorem.

share|cite|improve this answer

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.