2. Let $n \geq 2$ be an integer. We color all the squares of an $n \times n$ chessboard in red or blue such that every $2 \times 2$ square contained in the chessboard has exactly two red and two blue squares.

How many possible colorings are there?

NOTE: Two colorings that can be obtained from each other by a rotation or reflection of the chessboard are considered distinct.
SOLUTION: Fix a coloring of the first row of the chessboard. This can be done in $2^{n}$ ways (2 choices for the color of each of the $n$ squares). We now show in how many ways a coloring of the first row can be completed to a coloring of the entire chessboard satisfying the required conditions. We will simply call a completion of a coloring a completion that satisfies the conditions of the problem.

First case: the squares of the first row have alternating colors. The possibilities for this type of coloring of the first row are 2: if the first square is colored red, then the second is colored blue, the third red, and so on. Conversely, if the first square is colored blue, then the second is colored red, the third blue, and so on.

In this case, the completions of the coloring to the second row are exactly those with alternating colors, and that is 2. Similarly, for each completion of the second row, there are 2 completions of the third row, and so on, for a total of $2^{n-1}$ completions and thus $2 \ldots 2^{n-1}=2^{n}$ possibilities relative to this case.

Second case: there exist two adjacent squares in the first row with the same color. The possibilities for this type of configuration are all except those for the first type of configuration, that is, $2^{n}-2$.

One possibility to complete the coloring to the second row is certainly to color each square of the second row differently from the one above it. On the other hand, this is the only possibility, since below two adjacent squares of the same color, there must be two squares of different colors, and therefore necessarily to their left and right there must be squares of a different color from those above them, and so on. In conclusion, there is only one completion of the coloring to the second row. Similarly, there is only one completion of the coloring to each subsequent row after the first, for a total of $2^{n}-2$ possibilities relative to this case.

The total number of colorings is thus the sum of those relative to the first and second cases, and that is

$$
2^{n}+2^{n}-2=2^{n+1}-2 .
$$