Color each cell of a $3×3$ table with one of $3$ colors. What is the number of ways to do so if adjacent cells have different colors?
Of course we consider two paintings the same (equivalent) if exist reflection or rotation which take one to another. So
$$ \begin{array} {|r|r|r|} \hline \color{blue}{B}& \color{yellow}{Y} &\color{red}{R} \\ \hline \color{red}{R}& \color{red}{R}&\color{red}{R}\\ \hline \color{red}{R}& \color{red}{R}& \color{red}{R} \\ \hline \end{array} \;\;\;\;\;{\rm and} \;\;\;\;\; \begin{array} {|r|r|r|} \hline \color{red}{R}& \color{red}{R}& \color{blue}{B} \\ \hline \color{red}{R}& \color{red}{R}& \color{yellow}{Y} \\ \hline \color{red}{R}& \color{red}{R}& \color{red}{R} \\ \hline \end{array} $$ are the same colorings.
Since marked cells are ''independent'' we can color them at random but not with all 3 colors.
\begin{array} {|r|r|r|} \hline & X & \\ \hline X & &X \\ \hline & X& \\ \hline \end{array}
Case 1: If all $X$ are colored with the same color, then for each unmarked cell we have 2 posibilites. So in this case we have $3\cdot 2^{5}$ possibile colorings. But clearly some of them are equivalent. What should I do? Divide this with 4? Or 16? Something else?
Case 2: $Y$ is of different color then $X$. Now we have $3$ colors for $Y$ and $2$ for $X$. Rest of the places we can color $1^3\cdot 2^2$ so we have $6\cdot 2^{2}$ possibile colorings. But again reflections across midlle colum give us equivalent colorings so we should divide this by $2$? \begin{array} {|r|r|r|} \hline & Y & \\ \hline X & &X \\ \hline & X& \\ \hline \end{array}
Case 3: ... \begin{array} {|r|r|r|} \hline & Y & \\ \hline Y & &X \\ \hline & X& \\ \hline \end{array}
Is there more elegant aproach?
We can use Burnside's lemma to account for symmetries. By the OEIS, there are 246 different 3-colourings of a labelled 3×3 grid graph (i.e. before accounting for symmetry).
This graph's non-identity symmetries are as follows. The general form of a colouring invariant under this symmetry is shown, then a calculation of the number of such colourings.
Burnside's lemma then gives the number of colourings up to symmetries as $$\frac{246+2×12+30+2×54+2×72}8=\color{red}{69}$$