2.2 Lattice points on a circle 113
Appendix: Number of lattice points inside a circle
Given a real numberr, how many lattice points are there inside or on the
circle of radiusr, center at the origin?
Write a computer program to find out exactly how many lattice points
are inside or on the circle radius 100.
For large values ofR, the numberK(R)of lattice points inside and
on the circle of radius
√
Rsatisfies
πR−π(2
√
2
√
R−2)<K(R)<πR+π(2
√
2
√
R+2).
This is often expressed by writing
K(R)=πR+O(
√
R).
Appendix: Number of lattice points under a hyperbola
Given a real numberR, how many lattice points in the first quadrant are
under the hyperbolaxy=R(but not on the axes)?
This number is
H(R)=
∑
1 ≤n≤R
d(n).
As a crude estimate,H(R)=RlogR+O(R). A better estimate was
given by Dirichlet
H(R)=RlogR+(2γ−1)R+O(
√
R).
Here,γis the Euler constant
lim
n→∞
(
1+
1
2
+
1
3
+···+
1
n
)
−logn≈ 0. 5772157 ···.