I've noticed that for any prime $p$ where $p = 2x+1$, a square $w^2$ can only take on $x$ possible congruence classes modulo $p$.
I've also noticed that:
$x^2 \equiv (x+1)^2 \pmod p$
$(x-1)^2 \equiv (x+2)^2 \pmod p$
$\vdots$
$1 \equiv (2x)^2 \pmod p$
For example, for $7$, we have:
$3^2 \equiv 4^2 \pmod 7$
$2^2 \equiv 5^2 \pmod 7$
$1 \equiv 6^2 \pmod 7$
Is this always true for $p > 7$? If so, why is it true? If it is not always true, can you give an example where it is not true?
Thanks,
-Larry
Based on the comments, given, I will attempt to answer my own question.
First, the reason that the following is true:
$x^2 \equiv (x+1)^2 \pmod p$
$(x-1)^2 \equiv (x+2)^2 \pmod p$
$\vdots$
$1 \equiv (2x)^2 \pmod p$
is because since $p$ is odd:
$x^2 \equiv (-x)^2 \equiv (p-x)^2 \equiv (2x+1 -x)^2 = (x+1)^2 \pmod p$
$(x-1)^2 \equiv (-x+1)^2 \equiv (p -x+1)^2 \equiv (2x+1-x+1)^2 \equiv (x+2)^2 \pmod p$
$\vdots$
$1^2 \equiv (-1^2) \equiv (p-1)^2 \equiv (2x+1-1)^2 \equiv (2x)^2 \pmod p$
There are $x$ possible congruence classes because there are $2x$ congruence classes that not congruent to $0 \pmod p$ and since for each $c^2 \equiv (p-c)^2$, it follows that $w^2$ can only take on $x$ possible values.
If we include $p^2$, it follows that there are $x+1$ distinct congruence classes. Since each congruence class is called a quadratic residue, it follows that there are $x+1$ quadratric residues.