A227133 Given a square grid with side n consisting of n^2 cells (or points), a(n) is the maximum number of points that can be painted so that no four of the painted ones form a square with sides parallel to the grid.
1, 3, 7, 12, 17, 24, 32, 41, 51, 61, 73, 85, 98
Offset: 1
Examples
n=9. A maximum of a(9) = 51 points (X) of 81 can be painted while 30 (.) must be left unpainted. The following 9 X 9 square is an example: . X X X X X . X . X . X . . X X X X X X . . X . X . X X . . X X X X . . X X X . X . . X X X . X X X . . . X . X X . . X X . X X X . X . X . X X . X X X X X X X . Here there is no subsquare with all vertices = X and having sides parallel to the axes.
Links
- Dmitry Kamenetsky, Best known solutions for n = 17..20
- Peter Karpov, InvMem, Item 20 [Link added by _N. J. A. Sloane_, Feb 24 2016]
- Peter Karpov, Ascension Optimization Framework [Link added by _N. J. A. Sloane_, Feb 24 2016]
- Peter Karpov, Best configurations known for n = 11..16
- Giovanni Resta, Illustration of a(2)-a(10)
- Giovanni Resta, Individual illustration for a(8)
Crossrefs
Programs
-
Mathematica
a[n_] := Block[{m, qq, nv = n^2, ne}, qq = Flatten[1 + Table[n*x + y + {0, s, s*n, s*(n + 1)}, {x, 0, n-2}, {y, 0, n-2}, {s, Min[n-x, n-y] -1}], 2]; ne = Length@qq; m = Table[0, {ne}, {nv}]; Do[m[[i, qq[[i]]]] = 1, {i, ne}]; Total@ Quiet@ LinearProgramming[Table[-1, {nv}], m, Table[{3, -1}, {ne}], Table[{0, 1}, {nv}], Integers]]; Array[a,8] (* Giovanni Resta, Jul 14 2013 *)
Extensions
a(10) from Giovanni Resta, Jul 14 2013
a(11) from Paul Tabatabai using integer programming, Sep 25 2018
a(12)-a(13) from Simon Felix using integer programming, Nov 22 2019
Comments