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.
LINKS
Kirill Ustyantsev, illustrated example
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