I'm trying to prove the following claim.
If $p$ is prime then $$|\{n^2 \pmod p\mid n \in [0, p-1]\}| = \frac{p+1}{2}$$
Where do I start? Would a proof by contradiction, contrapositive, or a direct proof be more intuitive than the other?
Thanks.
I'm trying to prove the following claim.
If $p$ is prime then $$|\{n^2 \pmod p\mid n \in [0, p-1]\}| = \frac{p+1}{2}$$
Where do I start? Would a proof by contradiction, contrapositive, or a direct proof be more intuitive than the other?
Thanks.
Idea $$n^2\mod p = (p - n)^2\mod p$$