login
A303644
a(n) is the number of lattice points in a Cartesian grid between a square of side length 2*n, centered at the origin, and its inscribed circle. The sides of the square are parallel to the coordinate axes.
4
0, 0, 0, 4, 4, 12, 24, 32, 40, 48, 68, 92, 100, 120, 136, 168, 192, 220, 244, 268, 312, 336, 376, 420, 444, 484, 524, 576, 624, 664, 724, 764, 820, 868, 912, 992, 1040, 1116, 1156, 1220, 1304, 1368, 1440, 1496, 1564, 1660, 1732, 1816, 1888, 1960, 2032, 2116, 2220, 2308
OFFSET
1,4
COMMENTS
The borders of the square and the circle are not included. Rotating the square by 45 degrees (so that its vertices lie on the coordinate axes) results in sequence A303646 instead.
FORMULA
a(n) = A016754(n-1) - A000328(n) - 4.
EXAMPLE
For n = 4, we have 4 points with integer coordinates; the point in the first quadrant is at (3,3):
.
o . . + . . o
. . . + . . .
. . . + . . .
-+-+-+-+-+-+-+-
. . . + . . .
. . . + . . .
o . . + . . o
.
Similarly, for n = 5, we have 4 points with integer coordinates; the point in the first quadrant is at (4,4):
.
o . . . + . . . o
. . . . + . . . .
. . . . + . . . .
. . . . + . . . .
-+-+-+-+-+-+-+-+-+-
. . . . + . . . .
. . . . + . . . .
. . . . + . . . .
o . . . + . . . o
.
For n = 6, we have 12 points, of which the 3 points in the first quadrant are at (4,5), (5,4), and (5,5):
.
o o . . . + . . . o o
o . . . . + . . . . o
. . . . . + . . . . .
. . . . . + . . . . .
. . . . . + . . . . .
-+-+-+-+-+-+-+-+-+-+-+-
. . . . . + . . . . .
. . . . . + . . . . .
. . . . . + . . . . .
o . . . . + . . . . o
o o . . . + . . . o o
PROG
(Python)
import math
for n in range(1, 100):
count = 0
for x in range(1, n):
for y in range(1, n):
if x * x + y * y > n * n and x < n and y < n:
count = count + 1
print(4 * count, end=", ")
(PARI) a(n) = sum(x=-n+1, n-1, sum(y=-n+1, n-1, (x^2+y^2) > n^2)); \\ Michel Marcus, May 22 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Kirill Ustyantsev, Apr 27 2018
STATUS
approved