[ Combinatorics of orbits ]  $[$ [ rule of product ]

$p$ - a prime number. How many ways are there to color the vertices of a regular $p$-gon using $a$ colors?

(Colorings that can be matched by rotation are considered the same.)

#
Let's temporarily forget about combining colorings by rotations. Then $p$ vertices can be colored in $a^{p}$ ways (see problem 60348). Among these colorings, there are $a$ monochromatic ones. Each of the remaining colorings matches with $p$ colorings (including the original one). Therefore, the number of different non-monochromatic colorings is $p$ times less: $\frac{a^{p}-a}{p}$.

## Answer

$\frac{a^{p}-a}{p}+a$ ways.