number of quadratic residues and nonresidues modulo p odd prime I read that for odd prime $p$, number of quadratic residues modulo $p$ is $\frac{p+1}{2}$ including $0$ and the number of nonresidues are $\frac{p-1}{2}$.
Could you help me see this? Is this a specific case of a more general result?

For an odd prime $p$, we have:
$$x^2 \equiv (p-x)^2 \pmod p$$
So there are at most $\frac{p-1}{2}$ non-zero quadratic residues, and at most $\frac{p+1}{2}$ quadratic residues counting zero.
Now, using $a,b\in\left\{1\dots\frac{p-1}{2}\right\}$, we produce $\frac{p-1}{2}$ different quadratic residues, because if $a^2\equiv b^2 \pmod p$ with $a\ne b$, and $1\le a,b\le\frac{p-1}{2}$, we have
$$(a-b)(a+b) \equiv 0 \pmod p$$
and as we have neither $p|(a-b)$ nor $p|(a+b)$, this is impossible.
As we have $\frac{p+1}{2}$ quadratic residues, we have $p-\frac{p+1}{2}=\frac{p-1}{2}$ non-quadratic residues.
