I recently was trying to figure out if there was an simple way to tell how many unique outcomes can be produced from the following equation:
$k^2 \mod m$
where $m$ is some odd prime number and $k$ is some integer.
After running a series of brute tests, I was able to derive the following equation:
$C=$$(m+1)\over2$
where $C$ is the amount of unique outcomes.
From what I've tested, this equation I've derived works, however I'm a bit lost as to how I can prove such an equation is valid for all $m$. Has this already been proven somewhere? If not, any guidance or help towards a solution would be greatly appreciated.