← Recreational maths

Lab · Lattice points

Gauss's circle problem

How many lattice points lie inside a circle of radius R? About πR², obviously. How far off that guess can be is one of the oldest open problems in number theory.

Let $N(R)$ be the number of points $(x, y) \in \mathbb{Z}^2$ with $x^2 + y^2 \le R^2$. Each lattice point owns a unit square, and those squares cover the disc up to a strip of width about $1$ along its edge, so Gauss observed that $$N(R) = \pi R^2 + E(R), \qquad |E(R)| \le \sqrt2\,\pi R + \tfrac{\pi}{2}.$$ The question is the true size of the error $E(R)$. Watch the circle grow over the lattice on the left and the error wobble on the right.

Where things stand

Sierpiński proved $E(R) = O(R^{2/3})$ in 1906 by grouping the lattice points along short arcs. A long series of improvements using exponential sums (van der Corput, Vinogradov, Huxley and others) has brought the exponent down only to about $0.63$. In the other direction, Hardy and Landau showed in 1915 that $E(R)$ is not $O(R^{1/2})$: it is occasionally larger than $c\,R^{1/2}(\log R)^{1/4}$. The conjecture is that $1/2$ is the truth: $$E(R) = O(R^{1/2 + \varepsilon}) \quad\text{for every } \varepsilon > 0.$$ The graph supports it: the error has the size of $\sqrt R$, now and then reaching a few times $\sqrt R$ (for $R \le 200$ the extreme is about $5.8\sqrt R$, near $R = 195$). Cramér showed that the mean square of $E$ grows like a constant times $R$, so a typical error is of order $\sqrt R$; the conjecture says the rare large values never outgrow $R^{1/2+\varepsilon}$.

Sums of two squares

Counting lattice points by distance is counting representations as a sum of two squares. If $r_2(n)$ is the number of $(x, y)$ with $x^2 + y^2 = n$, then $N(R) = \sum_{n \le R^2} r_2(n)$, and Jacobi's formula $r_2(n) = 4\,(d_1(n) - d_3(n))$, where $d_i(n)$ counts divisors $\equiv i \pmod 4$, turns the circle problem into a problem about divisors. This is why it is a twin of Dirichlet's divisor problem for the hyperbola, and why the same exponents appear in both. Hover over a lattice point to see $r_2$ of its squared distance.

Full proof: the error is at most a constant times R

Proposition. For $R \ge 1$, $|N(R) - \pi R^2| \le \sqrt2\,\pi R + \tfrac{\pi}{2}$.

Proof. Attach to each lattice point $(x, y)$ the unit square $[x - \tfrac12, x + \tfrac12] \times [y - \tfrac12, y + \tfrac12]$. Each square has diameter $\sqrt2$, so every point of it is within $\tfrac{\sqrt2}{2}$ of its centre. Let $\rho = \tfrac{\sqrt 2}{2}$. If $(x, y)$ is inside the circle of radius $R$, its square lies inside the circle of radius $R + \rho$. Conversely every point of the disc of radius $R - \rho$ lies in some square, whose centre is then within $R$ of the origin, so these squares cover that smaller disc. The squares do not overlap, so comparing areas, $$\pi (R - \rho)^2 \le N(R) \le \pi (R + \rho)^2.$$ Hence $|N(R) - \pi R^2| \le 2\pi\rho R + \pi\rho^2 = \sqrt2\,\pi R + \tfrac{\pi}{2}$, as claimed. $\square$

Further reading

  • G. H. Hardy, On the expression of a number as the sum of two squares, Quarterly Journal of Mathematics 46 (1915).
  • M. N. Huxley, Exponential sums and lattice points III, Proceedings of the London Mathematical Society 87 (2003).
  • A. Ivić, E. Krätzel, M. Kühleitner and W. G. Nowak, Lattice points in large regions and related arithmetic functions: recent developments in a very classic topic, 2004 (arXiv:math/0410522).