On this page
Draw a square grid, put the point of a compass on one dot and draw a circle of radius r. How many dots land inside or on the circle? That is the Gauss circle problem: N(r) is the number of integer pairs (x, y) with x² + y² ≤ r² (MathWorld, Gauss's circle problem). A Class 10 student can state it; researchers have not finished it.
How do you count lattice points in a circle by hand?
Go column by column. For a fixed x, y can run from −⌊√(r² − x²)⌋ to +⌊√(r² − x²)⌋, so that column holds 2⌊√(r² − x²)⌋ + 1 points. Add up the columns.
Worked example, r = 5 (r² = 25):
x = 0: √25 = 5, so 11 points
x = ±1, ±2, ±3: √24, √21 and √16 all floor to 4, so 9 points each
x = ±4: √9 = 3, so 7 points each
x = ±5: 1 point each
Total: 11 + 2 × (9 + 9 + 9 + 7 + 1) = 81. The same method gives every value from r = 1 to 10, matching entry A000328 of the On-Line Encyclopedia of Integer Sequences. In brackets is the area πr²:
r = 1 to 5: 5 (3.14), 13 (12.57), 29 (28.27), 49 (50.27), 81 (78.54)
r = 6 to 10: 113 (113.10), 149 (153.94), 197 (201.06), 253 (254.47), 317 (314.16)
Why is N(r) approximately πr²?
Give every lattice point the unit square centred on it. The squares do not overlap, so N(r) equals the total area of the squares of points in the circle. They fill the disc except along the edge.
The ratio N(r)/r² tends to π as r grows (MathWorld). At r = 10 it is already 317/100 = 3.17, within 1% of π.
What error bound did Gauss prove?
Write N(r) = πr² + E(r). Half the diagonal of a unit square is √2/2 ≈ 0.71, so every counted square lies inside the circle of radius r + 0.71, and the squares cover the whole circle of radius r − 0.71. Comparing areas gives π(r − 0.71)² ≤ N(r) ≤ π(r + 0.71)², so the error is at most about 4.44r + 1.57. It grows no faster than a constant times r, written O(r). MathWorld records Gauss's bound as |E(r)| ≤ 2√2πr for r ≥ 1.
The real errors are far smaller. From the list above, E(10) = 317 − 314.16 ≈ 2.84, while 2√2π × 10 ≈ 88.9.
How small is the error term conjectured to be?
Mathematicians call the best exponent θ: the smallest t for which E(r) = O(r^(t+ε)) for every ε > 0. MathWorld's table of bounds tells the story:
Gauss: θ ≤ 1.
Voronoi (1903), Sierpiński (1906) and van der Corput (1923): θ ≤ 2/3.
Hardy and Landau (1915): θ ≥ 1/2, so no exponent below 1/2 can work.
Huxley (2003): θ ≤ 131/208 ≈ 0.6298, published in the Proceedings of the London Mathematical Society.
Li and Yang (2023): about 0.6290.
Cen and coauthors (2026): 209/335 ≈ 0.6239.
The conjecture is that θ = 1/2, that is, E(r) = O(r^(1/2+ε)) for every ε > 0 (Wikipedia, Gauss circle problem). Work continues: a preprint posted on arXiv on 30 November 2026 claims an exponent of about 0.6234 (written there as 293/940, because it measures size by r² rather than r). It has not yet been through peer review.
How is the circle problem linked to sums of two squares?
A point (x, y) with x² + y² = n is a way of writing n as a sum of two squares. If r₂(n) counts those ways, with signs and order mattering, then N(r) = r₂(0) + r₂(1) + … + r₂(r²) (MathWorld). For r = 5, the 12 points on the circle come from 25 = 0² + 5² = 3² + 4². Our post on how many lattice points lie on a circle works out r₂(n) in general, and Fermat's rule for which primes are sums of two squares explains why primes of the form 4k + 1 matter.
Jacobi's two-square theorem turns this into an exact formula (Wikipedia; OEIS A000328): N(r) = 1 + 4 × the sum over j ≥ 0 of (⌊r²/(4j+1)⌋ − ⌊r²/(4j+3)⌋). Check r = 2: the j = 0 term is 4 − 1 = 3 and later terms are 0, so N(2) = 1 + 12 = 13. Divide by r² and let r grow: the bracket becomes 1 − 1/3 + 1/5 − 1/7 + …, the Leibniz series for π/4 (MathWorld).
A 20-minute practice plan
Count N(4) by columns and compare with the list.
Use the floor formula to get N(3) = 29.
Write a short loop for N(r) up to r = 100 and print E(r)/r.
If floors or O-notation feel shaky, the Fermi Concept Library has a lesson on every concept in mathematics. For more counting problems, the Fermi Problem Library has a step-by-step solver that explains the reasoning. Next, try Minkowski's theorem on lattice points.



