Question 158
Given a positive integer $n$. Given a square table of sizes $3 \times 3$. One uses $n$ colors to paint the squares of the table in such a way, that each square is painted by one color. Two ways of painting is considered to be similar if they can be obtained from each other by rotating the table around its center. How many non-similar ways of painting are there?