TITLE: AMC 2011 Coloring Problem
QUESTION [9 upvotes]: A 40 X 40 white square is divided into 1 X 1 squares by lines parallel to its sides. Some of these 1 X 1 squares are coloured red so that each of the 1 X 1 squares, regardless of whether it is coloured red or not, shares a side with at most one red square (not counting itself). What is the largest possible number of red squares?
What I did is as following(R is red, w is white), There are only 400 red squares. The answer should be more. (Sorry, the previous diagram was wrong, I missed every empty White lines. Now I fixed it. ):
RRwwRRwwRRww...RRww
wwwwwwwwwwww...wwww
wwRRwwRRwwRR...wwRR
wwwwwwwwwwww...wwww
RRwwRRwwRRww...RRww
wwwwwwwwwwww...wwww
wwRRwwRRwwRR...wwRR
...................
RRwwRRwwRRww...RRww
wwwwwwwwwwww...wwww
wwRRwwRRwwRR...wwRR
wwwwwwwwwwww...wwww

REPLY [3 votes]: In a separate answer, user TonyK has shown that it is possible to have as many as $420$ red squares on the board, and that it remains to show that the number of red squares is strictly less than $421$. Below I will complete the proof by showing that the number of red squares must be strictly less than $421$. To see how it is possible to have $420$ red squares, you can look at user TonyK's answer, or you can click the link in his answer, which will take you to this website on Yahoo.
Suppose we have a $40\times40$ white board, and we color some of the squares red, so that each square shares a side with at most one red square. Let $R$ be the number of red squares. It has been shown that there is a way of doing this with $R=420$. Our goal is to show that $R<421$.
Since the board is $40\times40$, the board consists of $1600$ $1\times1$ squares. Let $\mathcal{S}$ be the set of all $1600$ of these $1\times1$ squares. For each $x\in\mathcal{S}$, let $f(x)$ be the number of red squares that share a side with $x$. We'll start be examining the sum
$$\sum_{x\in\mathcal{S}}f(x).$$
The number of times a red square is counted in this sum depends on whether the red square is a corner square, an edge square, or an interior square. So let $C$ be the number of red corner squares. Let $E$ be the number of red edge squares, and let $I$ be the number of red interior squares. In the above sum, red corner squares are counted twice; red edge squares are counted three times, and red interior squares are counted four times. Hence
$$\sum_{x\in\mathcal{S}}f(x)=2C+3E+4I.$$
Since each squares shares a side with at most one red square, we have that $f(x)\le1$ for each $x\in\mathcal{S}$. So
$$\sum_{x\in\mathcal{S}}f(x)\le1600.$$
Hence $2C+3E+4I\le1600$. We want to maximize $R=C+E+I$ subject to the constraint that $2C+3E+4I\le1600$. We haven't gotten enough information yet to show that $R<421$ so we will have to examine the problem further to come up with some additional constraints.
We can get the constraints we need by considering the squares on the border of the board, i.e. the corner and edge squares. In user TonyK's answer, it is shown that is possible to have as many as $78$ red squares on the border. This is done by working your way around the border, coloring two squares red and then leaving two squares white, until half the border is red. If the border had more than $78$ red squares, then it follows from the pigeon-hole principle that there would be $4$ consecutive border squares, $3$ of which are red, which would contradict the fact that no square shares a side with more than one red square. Hence $C+E\le78$.
For our last constraint, we can use the fact that there are four corners. So $C\le4$.
So we want to maximize
$$R=C+E+I$$
given that
$$2C+3E+4I\le1600$$
$$C+E\le78$$
$$C\le4$$
$$C,E,I\ge0.$$
Readers familiar with linear programming will recognize that this a problem that can be solved with the simplex method. However, our goal is just to show that $R<421$, which can be done without the simplex method. If we add the the three $\le$ constraints, we get that $4C+4E+4I\le1682$. 
Hence $R=C+E+I\le\frac{1681}{4}=420.5.\;$ So $R<421$. $\;\square$
Acknowledgments: I would like to thank user TonyK for showing me that it was possible to have $R=420$. Without his help, I may not have been to get this problem. I would also like to thank user Rob Pratt, who provided a substantial simplification.
Closing Remark: If we modify the problem slightly, then the configuration mentioned in the original problem will in fact be optimal. Suppose that the original $40\times40$ board were inscribed on a torus instead of a just a $40\times40$ square. Now the squares on the bottom row share sides with squares on the top row, and squares on the leftmost column share sides with squares on the rightmost column. It follows that
$$\sum_{x\in\mathcal{S}}f(x)=4R.$$
Hence $R\le400$. So the configuration mentioned in the original problem would be optimal.