login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

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.
2
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,7
COMMENTS
For n > 0, the pattern fails to add a square if n is of the form k^2+1 (A002522) or k^2-k+1 (A002061). Taken together, these numbers are: 1, 2, 3, 5, 7, 10, 13, 17, ... All other numbers add one unit square to the pattern (see example).
EXAMPLE
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.
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);
PROG
(PARI) a(n) = sum(i=1, n, !(issquare(i-1) || issquare(floor(i-sqrt(i-1))))); \\ Michel Marcus, Mar 21 2021
CROSSREFS
Cf. A002061 (n^2-n+1), A002522 (n^2+1).
Sequence in context: A064506 A082774 A074239 * A303905 A341904 A237638
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Oct 04 2014
STATUS
approved