login
Consider a square grid with side n consisting of n^2 cells (or points); a(n) is the minimal number of points that can be painted black so that, out of any four points forming a square with sides parallel to the sides of the grid, at least one of the four is black.
6

%I #33 May 05 2023 09:06:43

%S 0,1,2,4,8,12,17,23,30,39,48,59,71

%N Consider a square grid with side n consisting of n^2 cells (or points); a(n) is the minimal number of points that can be painted black so that, out of any four points forming a square with sides parallel to the sides of the grid, at least one of the four is black.

%C On a 4 X 4 square grid, there are 14 lattice squares parallel to the axes. What is the fewest dots you can remove from the grid such that at least one vertex of each of the 14 squares is removed? The answer is a(4) = 4. In general a(n) is the answer for an n X n grid.

%C This is a "set covering problem", which can be handled by integer linear programming for small n. - _Robert Israel_, Mar 25 2009

%C This sequence is complementary to A227133: A227133(n) + a(n) = n^2.

%H Ed Wynn, <a href="https://arxiv.org/abs/1810.12975">A comparison of encodings for cardinality constraints in a SAT solver</a>, arXiv:1810.12975 [cs.LO], 2018.

%e 1 X 1: 0 dots, since there are already no squares,

%e 2 X 2: 1 dot, any vertex will do,

%e 3 X 3: 2 dots, the center kills all the small squares and you need one corner to kill the big square,

%e a(4) = 4: there are 4 disjoint squares, so it must be at least 4, and with a little more work you can find a set of 4 dots that work.

%e From _Robert Israel_: (Start)

%e For the 5 X 5 case, Maple confirms that the optimal solution is 8 dots,

%e which can be placed at

%e [1, 1], [1, 3], [2, 2], [2, 3], [3, 0], [3, 1], [3, 2], [4, 4]

%e For the 6 X 6 case, Maple tells me that the optimal solution is 12 dots,

%e which can be placed at

%e [0, 5], [1, 1], [1, 2], [1, 4], [2, 0], [2, 3], [2, 4], [3, 1], [3, 3],

%e [4, 0], [4, 4], [5, 2]

%e For the 7 X 7 case, Maple tells me that the optimal solution is 17 dots,

%e which can be placed at

%e [0, 0], [1, 2], [1, 3], [1, 5], [2, 1], [2, 4], [2, 5], [3, 2], [3, 3],

%e [3, 4], [4, 1], [4, 2], [4, 5], [5, 1], [5, 3], [5, 4], [6, 6]

%e For n=9, at least a(9) = 30 points (.) have to be removed while 51 (X) of 81 are remaining. The solution is unique (congruent images being ignored).

%e . X X X X X . X .

%e X . X . . X X X X

%e X X . . X . X . X

%e X . . X X X X . .

%e X X X . X . . X X

%e X . X X X . . . X

%e . X X . . X X . X

%e X X . X . X . X X

%e . X X X X X X X .

%e (End)

%Y See A227133 for an equivalent version of this problem.

%Y A227116 treats an analogous question but for equilateral triangles instead of squares.

%Y A000330 gives the number of subsquares in a square grid of side n.

%Y Cf. also A240443.

%K nonn,hard,more

%O 1,3

%A _Joshua Zucker_, Mar 25 2009

%E a(5)-a(7) from _Robert Israel_, Mar 25 2009

%E a(8)-a(9) from _Heinrich Ludwig_, Jul 01 2013

%E a(10) from _Giovanni Resta_, Jul 14 2013 (see A152125).

%E Reworded definition to align this with several similar sequences (A227133, A240443, A227116, etc.). - _N. J. A. Sloane_, Apr 19 2016

%E a(11)-a(13) (using A227133) from _Alois P. Heinz_, May 05 2023