How Many Integer Lattice Points Are Inside a Circle?
At a glance
- 1. Set the circle
For a circle centered at the origin, write its radius as R and use x² + y² ≤ R².
- 2. Choose each column
For every integer x from −⌊R⌋ to ⌊R⌋, find the largest allowed integer y.
- 3. Count each column
Add 2⌊√(R² − x²)⌋ + 1 for each x.
- 4. Check the boundary
If the circle is open rather than closed, remove the lattice points that lie exactly on its circumference.
A lattice point is a point whose coordinates are both integers. For a circle centered at the origin, counting the lattice points inside it means counting integer pairs whose distance from the origin is no greater than the radius.
The area of the circle, , gives a useful estimate, but it is not generally the exact count. The exact count can be found by checking the possible integer -coordinates and counting the allowed -coordinates in each vertical column.
Exact formula for a centered circle
Let the circle have radius and equation . For a fixed integer , the points in the disk satisfy
If , the permitted integer values of run from through . Thus that column contributes points. Summing over all possible integer gives
This formula counts points inside or on the circle. It applies even when is not an integer.
Worked example: radius 5
For , the integer -coordinates range from to . Because the disk is symmetric about the vertical axis, count once and double the counts for positive :
| -coordinate | Allowed integer -coordinates | Points in column |
|---|---|---|
| through | ||
| through | ||
| through | ||
| through | ||
| through | ||
Therefore,
So there are 81 integer lattice points inside or on the circle of radius 5. If “within” means strictly inside, exclude the 12 points on the circumference: , , and the eight points obtained by changing the signs of . The strict count is .
Connection to sums of two squares
Another way to organize the count is by distance from the origin. A lattice point on the circle of radius corresponds to an integer solution of . Let be the number of such ordered integer pairs, with signs and coordinate order counted. Then the number inside or on a radius- circle is
where the extra counts the origin. This viewpoint separates the points on each individual circle (each value of ) from the points in the whole disk.
For , a classical formula is , where and count the positive divisors of congruent to 1 and 3 modulo 4, respectively. For example, the positive divisors of 25 are 1, 5, and 25, all congruent to 1 modulo 4. Thus , matching the 12 lattice points on the radius-5 circumference.
If the circle has a different center
For a circle centered at with radius , the condition is . For each integer with , the allowed integer values run from
Count the integers in that range for each such and add them. The centered-circle formula is a special case with .
Common mistakes
- Using area as the exact count: estimates the number of lattice points, but it need not be an integer and usually is not the exact answer.
- Forgetting the floor: The largest permitted integer is the floor of the square root, not the square root itself.
- Mixing up boundary conventions: “Inside” may mean strictly inside, while “inside or on” includes the circumference. State which count you want.
- Counting only positive coordinates: The formula counts negative coordinates and zero as well. For example, and are distinct lattice points.
References
- An Introduction to the Theory of Numbers — G. H. Hardy and E. M. Wright
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.