Tell me more ×  The distribution of sums of two squares has been
studied by Landau. What is known about the distribution of the
function $r(n)$, the number of representations of $n$ as the sum
of two squares? Some specific questions of interest to us are
these. Suppose $a \leq n\leq b$. What is the average value of
$r(n)$? What is the standard deviation?  Edit: Thanks for the
answer and comments. I am particularly interested in the range
$a\leq n\leq b$ where $b-a = \Theta(\sqrt{a})$. Let $a,b$ be
like that, and let $C(n)$ be the circle of radius $n$ around a
fixed center.  Conjecture. The number of integers $n\in[a,b]$
with $r(n)>0$ is $\Omega(\sqrt{a})$. Furthermore, if $S$ is the
segment of $C(b)$ cut off by a chord of length
$\Omega(\sqrt{a})$ that touches $C(a)$ and if $r_S(n)$ is the
number of lattice points in $C(n)\cap S$ then the number of
integers $n\in[a,b]$ with $r_S(n)>0$ is $\Omega(\sqrt{a})$.
Added: Finally, with the help of Greg Martin, I got hold of
relevant literature and educated myself. T