How many numbers smaller that $N$ can be written as a sum of two square numbers? We define
$$a_N =\# \{ n \leq N, \exists (n_1,n_2) \in \mathbb{N}^2, n = n_1^2 + n_2^2 \}.$$
Can we have the exact value of $a_N$, or at least an asymptotic behavior such as $$ \alpha N \leq a_N  \leq \beta N$$ for some constant $\alpha,\beta>0$? (Of course, the existence of $\beta$ is obvious since $a_N \leq N+1$. I am particularly interested by the existence of a constant $\alpha$.)
Thanks for your attention.
 A: [Edit: I didn't read the post properly, so this answers a quite different though related question: what is the count of $(n_1,n_2)$ such that $n_1^2+n^2 \leq N$. Gerry Myerson's response answers the question that was actually asked.]
This is a nice question that was first studied thoroughly by Gauss and goes by the name 'Gauss's circle problem.'
We know that your $a_N$ is asymptotic to the area of a circle of radius $\sqrt{N}$; that is $a_N \sim \pi N$. A simple proof of this fact, with $r^2$ in place of your $N$ can be found in the first part of http://alpha.math.uga.edu/~pete/4400gausscircle.pdf
To obtain good bounds for $a_N-\pi N$ is still an open problem.
More information can be found at http://en.wikipedia.org/wiki/Gauss_circle_problem, or in classic books on number theory, like Hardy and Wright's 'An Introduction to the Theory of Numbers'.
A: E. Landau, "Über die Einteilung der positiven ganzen Zahlen in vier Klassen nach der Mindestzahl der zu ihrer additiven Zusammensetzung erforderlichen Quadrate," Arch. Math. Phys. (3), v. 13, 1908, pp. 305-312 proved that the number of sums of two squares up to $x$ is asymptotic to $Bx/\sqrt{\log x}$, where $$B={1\over\sqrt2}\prod_{p\equiv3\bmod4}(1-p^{-2})^{1/2}$$ See also P. Shiu, Counting sums of two squares: the Meissel-Lehmer method, Math. Comp. volume 47, number 175, 
July 1986, pages 351-360, available at http://www.ams.org/journals/mcom/1986-47-175/S0025-5718-1986-0842141-1/S0025-5718-1986-0842141-1.pdf
