When reading about Cipolla's algorithm on Wikipedia, I found that the number of quadratic non-residues in the image of $f:\Bbb F \longrightarrow \Bbb F, f(a) = a^2 - x^2$ where $\Bbb F$ is a finite field of prime cardinality $p$ and $x \in \Bbb F$, is $\frac{p-1} 2$. Why?
I was thinking that there might be some sort of symmetry between the nonzero quadratic residues and the quadratic nonresidues, but I don't see it.
[edit]
Wherever I previously said quadratic residue, it nows says quadratic nonresidue.
This is not true in general. Let $p=7$ and $x=1$. Then $a^2-1^2$ takes on values $-1,0,3,1$ modulo $7$. There is only one QR in the bunch, and two NR.
What is true for odd primes $p$ is that $f(a)$ takes on exactly $\frac{p-1}{2}$ diferent non-zero values modulo $p$. But this is obvious, since $a^2$ takes on $\frac{p-1}{2}+1$ values.
Remark: The Wikipedia article does not count the number of non-residues in the image of $f$. For each $a$ it makes a tick if $a^2-x^2$ is a NR, and it counts the number of ticks.