TITLE: Different Coloring of regular n-gon
QUESTION [7 upvotes]: By using Burnside's lemma, I want to find the number of different coloring of vertices of a regular n-gon, with X colors.
By "different" I mean : up to rigid motions.
I've seen some partial results, but I'm not sure about the genralized version.

REPLY [10 votes]: Let $C = \{1, ...,X\}^n$ represent the set of colorings of $n$ labeled vertices. The dihedral group $D_n$ acts on $C$ by permuting elements, representing the rigid motions of an $n$-gon. The "distinct colorings" we're looking for are the orbits of this group action.
Burnside's Lemma tells us that the number of orbits is equal to the average number of fixed points of a group element. So for each element $g \in D_n$, we should calculate $|C^g|$, the number of colorings in $C$ that are unchanged by $g$.
$D_n$ consists of $n$ rotations (including the identity element, which we can think of as a rotation by $n$ steps) and $n$ reflections.
If $g$ is a rotation by $k$ steps, then choosing a fixed point of $g$ corresponds to freely choosing the colors of $\gcd(n, k)$ adjacent vertices; the constraint that our coloring is unchanged by $g$ forces us to repeat this color sequence around the polygon, determining the remaining vertices' colors. So $|C^g|=X^{\gcd(n, k)}$.
If $g$ is a reflection, then to build a fixed point we can freely choose the colors of any vertices that lie on the axis of reflection, and the remaining vertices must be colored in pairs so that they match their reflections. If $n$ is odd, each reflection has one vertex on its axis, so $|C^g|=X^{(n+1)/2}$. If $n$ is even, half of the reflections have two vertices on their axis (yielding $|C^g|=X^{n/2+1}$) and the other half have none (yielding $|C^g|=X^{n/2}$).
Putting these things together and taking the average, we find that the number of orbits is
$$
\frac 1{2n}
\left(
\sum_{k=1}^n X^{\gcd(n, k)}
+
\begin{cases}
n X^{(n+1)/2}  & \text{$n$ odd} \\
\frac n 2 X^{n/2+1} + \frac n 2 X^{n/2} & \text{$n$ even}
\end{cases}
\right).
$$