A302829 a(n) is the number of lattice points in a Cartesian grid between a circle of radius n and an inscribed square whose vertices lie on the coordinate axes.
0, 0, 4, 8, 12, 28, 36, 52, 72, 88, 112, 128, 156, 192, 220, 252, 280, 324, 368, 408, 448, 504, 548, 592, 644, 708, 776, 828, 880, 952, 1016, 1096, 1164, 1236, 1324, 1388, 1472, 1548, 1648, 1736, 1808, 1912, 2004, 2116, 2212, 2300, 2408, 2508, 2624, 2728, 2860, 2976, 3076
Offset: 1
Keywords
Links
- Kirill Ustyantsev, Desmos graph calculator
Programs
-
PARI
a(n) = sum(x=-n, +n, sum(y=-n, +n, ((x^2+y^2) < n^2) && ((abs(x)+abs(y))^2 > n^2))); \\ Michel Marcus, May 22 2018
-
Python
for n in range (1, 100): count=0 for x in range (0, n): for y in range (0, n): if (x*x+y*y
n): count=count+1 print(4*count)
Comments