Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. 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

If we suppose that we are interested in non-negative integers less than a prime $p$, is it possible to find more than two of these integers, such that, when squared, are all congruent modulo $p$?

In other words, can we find non-negative integers $x$, $y$, $z$, such that $0 \le x < y < z < p$ and $x^2 \equiv y^2 \equiv z^2 \bmod p$

I believe that we can't, but I'm not sure how to prove this.

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

Note that the residues $\mod p$ form a field, so there are no zero divisors. If $x^2\equiv y^2 \equiv z^2 \pmod p$, you have $(y-x)(y+x)\equiv (z-x)(z+x) \equiv 0 \pmod p$ and you need a zero in each product.

share|cite|improve this answer

there are at most two solutions of $x^2 \equiv a \pmod p$.

In general, let $P(x)$ be a degree $n$ polynomial, there are at most $n$ solutions to $P(x) \equiv 0 \pmod p$ (because mod p is a field domain).

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.