A303646 a(n) is the number of lattice points in a Cartesian grid between a square with integer sides 2*n and its inscribed circle. The sides of the square are parallel to the bisector of coordinate axes.
0, 0, 12, 12, 32, 32, 32, 68, 60, 104, 104, 104, 156, 148, 216, 216, 300, 292, 276, 368, 368, 468, 460, 452, 560, 544, 676, 668, 816, 792, 784, 932, 916, 1080, 1048, 1048, 1220, 1212, 1384, 1360, 1352, 1556, 1532, 1736, 1704, 1956, 1924, 1900, 2136, 2096, 2340, 2308
Offset: 1
Keywords
Links
- Kirill Ustyantsev, Graphic illustration
Programs
-
PARI
a(n) = sum(x=-2*n, 2*n, sum(y=-2*n, 2*n, ((x^2+y^2) > n^2) && ((abs(x)+abs(y))^2 < 2*n^2))); \\ Michel Marcus, May 22 2018
-
Python
import math for n in range (1, 100): sqn = math.ceil(math.sqrt(2)*n) count = 0 for x in range(-sqn, sqn): for y in range(-sqn, sqn): if (x*x+y*y>n*n and abs(x)+abs(y)
Comments