Minimum number of marked squares on $n × n$ board

Consider an infinite checkerboard with squares labelled by pairs of integers and mark every square whose indices satisfy $$(i,j) \equiv (0,0) \pmod{4}$$ $$(i,j) \equiv (0,1) \pmod{4}$$ $$(i,j) \equiv (2,2) \pmod{4}$$ $$(i,j) \equiv (2,3) \pmod{4}$$ This provides a marking of the infinite board with the desired property such that every fourth square is marked. Thus we have that $$\lim_{n\rightarrow \infty} \frac{N}{n^2} = \frac{1}{4}$$ which is clearly the best possible asymptotic result.

In fact the value of N is n(n+2)/4. The full solution can be found here. http://www.cs.cornell.edu/~asdas/imo/imo/isoln/isoln993.html


jwsiegel has already provided both an asymptotic answer to the original question, and a link to a closed-form solution. I will address the Juan's question in the comments on jwsiegel's answer and Jens's follow-up question in the original post.

In answer to Juan's question, "For even n, this is better, but does this work if n is odd?":

Nothing in jwsiegel's asymptotic result makes any assumption on the parity of $n$. His answer provides a covering of the infinite plane which satisfies the rules given in the original post. When this marking is restricted to an $n \times n$ board, you get a marking of the board in which every interior square is adjacent to a marked board, with roughly a forth of the squares marked (exactly 1/4 if $n$ is a multiple of 4). To then cover the boundary as well, you need to add no more than $4(n-1)$ additional squares. When $n$ approaches infinity, this contribution becomes negligible, so we get that, for $n$ large, his covering of the board requires about a quarter of the squares to be marked. Since each square is adjacent to at most 4 other squares, it follows that this result is asymptotically optimal.

It is, in principle, possible to precisely calculate how many squares are marked by this procedure, but there is no reason to expect that it will be optimal for any fixed $n$. What the asymptotic solution does do is provide guidance for what a closed-form solution must satisfy, namely, that $$\lim_{n \to \infty} \frac{N}{n^2} = \frac{1}{4}.$$

Now, for OP's question. You forgot this part: "In every other such diagonal..." With that in mind, here are the cases you wrote up, corrected. Let the upper-left hand corner be white, as in your pictures. I've indicated the black squares using an ascii box; hopefully that should make it pretty clear.

$n=4$:

 X | ■ |   | ■ 
---------------
 ■ |   | ■ | X 
---------------
   | ■ |   | ■ 
---------------
 ■ | X | ■ |   

$n=6$:

 X | ■ |   | ■ | X | ■ 
-----------------------
 ■ |   | ■ |   | ■ |   
-----------------------
   | ■ | X | ■ |   | ■ 
-----------------------
 ■ |   | ■ |   | ■ | X 
-----------------------
 X | ■ |   | ■ |   | ■ 
-----------------------
 ■ |   | ■ | X | ■ |   

Observe that every black square is adjacent to exactly one marked white square. Now, as you observed, of course, no white square is adjacent to any marked square. But if we apply the exact same procedure to mark the black squares, then we obtain a marking of the entire board such that every square is adjacent to exactly one marked square. Then the claims are that (1) this board has $n(n+2)/4$ marked squares, and (2) this number of marked squares is optimal. Note that this closed form solution absolutely does depend on assuming that $n$ is even.