Number of necklaces If we have $3$ white, $4$ red and $5$ green pearls, how many distinct necklaces can be formed? I am also interested whether there is a general formula for necklaces that have $a_i,i=1,2,\dotsc,m$ pearls of color $c_i$ where $\sum_{i=1}^m a_i=n$.
 A: For this you need Pólya's enumeration theorem. In this particular case (12 beads in a bracelet, i.e., turning over is allowed) you need the cycle index of the group $D_{24}$:
$$
\zeta_{D_{24}}(x_1, \ldots, x_{12})
         = \frac{1}{24} \sum_{d \mid 12} \phi(d) x_d^{12 / d} 
              + \frac{1}{4} \left( x_1^2 x_2^5 + x_2^6 \right)
$$
Here $\phi(d)$ is Euler's totient, number of integers in 1 to $d$ relatively prime to $d$.
When there are $r$ colors, the generatting function
for $u_{n_1, n_2, \ldots, n_r}$, the number of bracelets with $n_1$ beads of color 1, $n_2$ of color 2, ..., $n_r$ of color $r$ is:
$$
U(z_1, z_2, \ldots, z_r)
     = \sum_{n_1, \ldots n_r} u_{n_1, \ldots, n_r} 
             z_1^{n_1} z_2^{n_2} \ldots z_r^{n_r}
     = \zeta_{D_{24}}(z_1 + \ldots + z_r,
                      z_1^2 + \ldots + z_r^2,
                      \ldots,
                      z_1^{12} + \ldots + z_r^{12})
$$
For particular cases grabbing the wanted $u_{n_1, \ldots, n_r}$ out of this humongous polynomial is easy (the cycle index leaves out many possible terms, check which ones contribute to the powers that interest you, ...), but don't ask for "general formulas"....
