While reading up on quadratic reciprocity, I learned that if $p = 4k+1$ then $-1$ has a square root in $\mathbb{Z} / p \mathbb{Z}$.


Let $r\_p$ be an integer with $0\leq r\_p < p$ and $r\_p^2 \equiv -1 \mod p$. How then is $\frac{r\_p}{p} \in \mathbb{Q}$ distributed in $[0,1]$? Naively I would guess this is uniform distribution. How can we prove that?




---


**Edit** I noticed in the comments, it might be simpler to ask about the equidistribution of $$\{ \tfrac{1}{\sqrt{p}}(a,b): a^2 + b^2 = p\} \subset S^1$$


still in the case $p = 4k+1$.



distribution of $\sqrt{-1} \mod p$
The equidistribution of the roots of quadratic congruences $\pmod p$ (such as $x^2+1$ in the question) was established in a famous paper of [Duke, Friedlander and Iwaniec](http://www.jstor.org/stable/2118527?seq=1#page_scan_tab_contents). The proof uses sieve ideas as well as ideas from the theory of modular forms. 


