A123689 Number of points in a square lattice covered by a circle of diameter n if the center of the circle is chosen such that the circle covers the minimum possible number of lattice points.
0, 2, 4, 10, 16, 26, 32, 46, 60, 74, 88, 108, 124, 146, 172, 194, 216, 248, 276, 308
Offset: 1
Examples
a(1)=0: Circle with diameter 1 with center (0.5,0.5) covers no lattice points; a(2)=2: Circle with diameter 2 with center (0,eps) covers 2 lattice points; a(3)=4: Circle with diameter 3 with center (0.5,0.5) covers 4 lattice points.
Links
- Hugo Pfoertner, Minimal number of points in the square lattice covered by circular disks. Illustrations.
Crossrefs
Programs
-
Mathematica
dx = 1/200; y0 = 0; (* To speed up computation, the step size dx is experimentally adjusted and the circle center is taken on the x-axis. *) cnt[pts_, ctr_, r_] := Count[pts, pt_ /; Norm[pt - ctr] <= r]; a[n_] := Module[{r, pts, innerCnt, an, center}, r = n/2; pts = Select[ Flatten[ Table[{x, y}, {x, -r - 1, r + 1}, {y, -r - 1, r + 1}], 1], r - 1 <= Norm[#] <= r + 1 &]; innerCnt = Sum[If[Norm[{x, y}] < r - 1, 1, 0], {x, -r - 1, r + 1}, {y, -r - 1, r + 1}]; {an, center} = Table[{innerCnt + cnt[pts, {x, y0}, r], {x, y0}}, {x, -1/2, 1/2, dx}] // Sort // First; Print["a(", n, ") = ", an, ", center = ", center // InputForm]; an]; Table[a[n], {n, 1, 20}] (* Jean-François Alcover, Jan 08 2018 *)
Comments