TITLE: Different ways of coloring a $4 \times 4$ game board
QUESTION [7 upvotes]: In how many ways a $4 \times 4$ game board can be colored using four colors (red, green, blue, yellow) in such a way that each small square has a single color and the board looks exactly the same from all sides?
For this particular problem since the board's dimension is $4 \times 4$ we could probably check by brute-forcing but I am inquisitive about how to solve this one for a $n \times n$ board with $n$ or $\space x$ colors?

REPLY [7 votes]: Each equivalence class of squares under rotation can be colored in $x$ different ways.  For even side length $n=2k$, there are $k^2$ equivalence classes of size $4$ (represented by the $k \times k$ squares in the upper left, say); for odd side length $n=2k+1$, there are $k^2+k$ classes of size $4$ (represented by the $k \times (k+1)$ squares in the upper left) and one of size $1$ (the center square).  The number of symmetric colorings is therefore $x^{k^2}$ for $n=2k$ and $x^{k^2+k+1}$ for $n=2k+1$.