4. (6) The cells of an $8 \times 8$ chessboard are colored in white and black such that in each $2 \times 2$ square, half of the cells are black and half are white. How many such colorings exist?
Solution: there are two cases. The first: if in the first column there are two consecutive squares of the same color, then the coloring of all the boards can be uniquely restored. There are $2^{8}-2$ such colorings. The second case: if the colors in the first column alternate, then the colors in the second column must also alternate, and so on. For each column, there are two alternating patterns (starting with white and starting with black). This results in another $2^{8}$ options. In total: 510.