A248333 Number of unit squares enclosed by n lattice points in and along the first quadrant of the coordinate plane starting from (0,0) and moving along each square gnomon starting on the y-axis and ending on the x-axis.
0, 0, 0, 0, 1, 1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 16, 16, 17, 18, 19, 20, 20, 21, 22, 23, 24, 25, 25, 26, 27, 28, 29, 30, 30, 31, 32, 33, 34, 35, 36, 36, 37, 38, 39, 40, 41, 42, 42, 43, 44, 45, 46, 47, 48, 49, 49, 50, 51, 52, 53, 54, 55, 56, 56, 57, 58, 59
Offset: 0
Keywords
Examples
Figure 1: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ------------------------------------------------------------------- n: 0 1 2 3 4 5 6 7 8 9 10 a(n): 0 0 0 0 1 1 2 2 3 4 4 -- . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ------------------------------------------------------------------- n: 11 12 13 14 15 16 17 a(n): 5 6 6 7 8 9 9 -- n = 4 -->(0,0), (0,1), (1,1), (1,0) enclose one unit square. n = 5 -->(0,0), (0,1), (1,1), (1,0), (0,2) also enclose one unit square. n = 6 -->(0,0), (0,1), (1,1), (1,0), (0,2), (1,2) enclose two unit squares.
Programs
-
Maple
A248333:=n->add(`if`(issqr(i-1) or issqr(floor(i-sqrt(i-1))),0,1),i=1..n): seq(A248333(n), n=0..100);
-
PARI
a(n) = sum(i=1, n, !(issquare(i-1) || issquare(floor(i-sqrt(i-1))))); \\ Michel Marcus, Mar 21 2021
Comments