Each cell of an grid square is colored black or white. We call such a coloring nice if every square covers an even number of black cells, and every cross covers an odd number of black cells. Find all such that in each nice coloring the four corner cells have the same color.
Solution
Color row 1 black and rows 2, 3 white. Then extend the coloring periodically with the remaining rows until the entire square is colored. It is immediate that the obtained coloring is nice. If or , the last row is white while the first one is black. So a necessary condition on is . We prove that it is sufficient.
For , consider a nice coloring. For convenience write 0 in each white cell and 1 in each black cell. Then each square covers numbers with even sum, and each cross covers numbers with odd sum. We need the following observations.
a. Consider two squares sharing one corner cell. The sum of the 8 numbers they cover, which is even, equals plus the sum of the numbers in the cross with center , which is odd. It follows that is odd. By symmetry this holds for every 3 consecutive diagonal cells, in both directions.
b. Let 4 consecutive diagonal cells cover the numbers , , , in this order. By a), and are odd, hence and have the same parity. Because both are 0 or 1, they are in fact equal: .
c. We claim that the four corner cells of each squares contain equal numbers. Let them be , , , , and let central four numbers be , , , as in the figure. The latter are covered by a square, hence and have the same parity (their sum is even). By a) the parity of (respectively ) is opposite to the one of (respectively ). It follows that and have the same parity. Hence they are equal. In addition and by b), therefore .
Observation c) is enough to finish the solution. It implies that the coloring is periodic with period 3, horizontally or vertically. Set and consider the numbers in cells 1, 4, 7, ..., of any row. By c) they are equal, in particular so are the numbers in the first and the last cell. By symmetry, the extremal cells in each column have equal numbers. Consequently the four corner numbers in the table are equal.
In conclusion the numbers satisfying the condition are .