Is this a trivial counterexample to basic Rosen number theory exercise

elementary-number-theory

Clearly, I'm missing something or misunderstanding something.

I've worked through the same question featured here. I was able to prove the following statement:

Show that if $p$ is an odd prime and $a$ is a positive integer not divisible by p, then the congruence $x^2 \equiv a \pmod{p}$ has either no solution or exactly two incongruent solutions.

But somehow I'm able to come up with counterexamples?

For example, $3$ is an odd prime. $1$ is a positive integer that is not divisible by $3$. Let $a = 1$, $p = 3$. Then $1^2 \equiv 1 \pmod{3}$; $(-1)^2 \equiv 1 \pmod{3}$; $2^2 \equiv 1 \pmod{3}$; and $(-2)^2 \equiv 1 \pmod{3}$; which violates? my conclusion of there being exactly two solutions for $x$ given an $a$ and $p$ as here there appears to be four solutions.

Any idea where my misunderstanding is? Thanks!

Best Answer

Your misunderstanding is that $-1\equiv2$ and $-2\equiv1\pmod3$, so they’re the same solutions.

Related Question