n \geq 2$ be natural numbers. We have four colors and want to color each field of an $m \times n$ rectangle with one of them, so that all four colors occur in every $2 \times 2$ square. How many different possibilities are there?

Note: We count two possibilities as different if there is at least one field that has been given different colors.
Solution: First let $m, n>2$. For the sake of simplicity, we replace the colors with numbers and consider three adjacent fields of a row, which are all colored differently (ObdA with 1, 2 and 3). They follow in sequence:
![](https://cdn.mathpix.com/cropped/2024_04_28_b2613f1944ca567cb87ag-4.jpg?height=418&width=1196&top_left_y=710&top_left_x=270)

This means that the entire columns containing the three 'start fields' are alternately colored with only two colors each. In particular, each row is colored with at least 3 different colors. Suppose there were three adjacent fields of a column at the same time, all of which were colored differently: Then there would also be three adjacent rows that are also colored with only two colors each, contradiction! Consequently, the rows or columns consist of only two colors each (which must always alternate). This is obviously also true for $m=2$ and $n=2$, i.e. always.

We now calculate the number of possibilities using this property. If the $m$ columns consist of only two colors each, then we have 6 possibilities to choose the two colors for the first, third, fifth etc. column. column. The colors for the remaining columns are then uniquely determined. For all $m$ columns, however, we can still choose which of the two possible colors we start with ( $2^{m}$ possibilities), i.e. a total of $6 * 2^{m}$ possibilities. Similarly, the case that the rows consist of only two colors each provides another $6 \cdot 2^{n}$ possibilities. However, we have now counted twice the cases in which both the rows and the columns consist of only two colors each. All these colorings are already clearly defined if we color the upper left $2 \times 2$ square. There are $4 \cdot 3 \cdot 2$ possibilities for this. So in total we get $6 \cdot 2^{m}+6 \cdot 2^{n}-24$ possibilities.