How many circular necklaces can be made with the length of p (a prime number), that can be created by connecting n different types of beads together

combinatoricsdiscrete mathematics

Given an unlimited number of beads of n different types, how many circular necklaces are there, with the length of p (a prime number), that can be created by connecting the beads together?

Note that two necklaces are identical if we can get one of the necklaces by rounding the other necklace.

I have an approach; First we count how many necklaces there to exist with the length of p and of n different beads and then we divide all the possibilities by the number of equivalence classes. I believe that there are 360/p different equivalence classes.

I am not certain whether this is the right approach, and also is this the right number of equivalence classes?

Disclaimer: I am asking this question for a friend who does not know how to use this site and cannot formulate a question that is comprehensible in English, so I apologize for any vague point.

Best Answer

This problem is well-known in combinatorics, you can look for example here: https://en.wikipedia.org/wiki/Necklace_(combinatorics)

The number of necklaces with $m$ beads and $n$ colors is $\frac{1}{m}\sum_{d|m}\phi(m/d)n^d$, where the sum is over all $d$ dividing $m$, and $\phi $ is Euler's totient function. When $m=p$ is a prime the sum has only two terms and it simplifies to $\frac{1}{p}(n^p+n p-n)$