How many different necklaces problem 
How many different necklaces can be made from 20 beads, each of a
  different color?

If I think this problem too simple then, I would answer (20-1)!. However now I thought that for example assume that we have 3 beads: blue-yellow-green. Then the blue-green-yellow necklace seems to be the same with blue-yellow-green necklace. (When I turn the first necklace, I can get the second one.) So I am wondering, is the number of different necklaces can be obtained is always the half of the ring permutation number? I mean for this question, is the answer (20-1)!/2 ? Also, how could I do the math if for example 5 of those beads were to be the same color? Would ((20-1)! / 5!) / 2 be the right answer?
Regards
Xentius
 A: Let $q_n$ be the solution for $n$ beads of different colors. This problem has special symmetries which make it possible to compute the answer without Polya counting, even though the latter can be applied and gives the correct answer. Quite simply, if all colors are different then the $n$ permutations that can be obtained by rotation from one another form an equivalence class and all equivalence classes are the same size, giving $$q_n = \frac{n!}{n} = (n-1)!.$$
Now if you wanted to do this by Polya counting you would use the cycle index $Z(C_n)$ of the symmetric group (the answers are the same). We have 
$$ Z(C_n) = \frac{1}{n} \sum_{d|n} \phi(d) a_d^{n/d}.$$
The answer is then given by
$$ [q_1 q_2 \cdots q_n] Z(C_n)(q_1, q_2, \ldots q_n)$$
where the $q_k$ are being substituted into the cycle index and represent exactly one color.
Remark Jun 19 2014. If all colors are different then only the $a_1^n$ term from the cycle index contributes, giving $$ [q_1 q_2 \cdots q_n] \frac{1}{n} (q_1+q_2+\cdots+q_n)^n = \frac{n!}{n} = (n-1)!.$$
The Maple code to do this is as follows:

with(numtheory);
with(group):
with(combinat):


pet_cycleind_cyclic :=
proc(n)
local d, s;

    s := 0;

    for d in divisors(n) do
        s := s + phi(d)*a[d]^(n/d);
    od;

    s/n;
end;

pet_varinto_cind :=
proc(poly, ind)
local subs1, subs2, polyvars, indvars, v, pot, res;

    res := ind;

    polyvars := indets(poly);
    indvars := indets(ind);

    for v in indvars do
        pot := op(1, v);

        subs1 :=
        [seq(polyvars[k]=polyvars[k]^pot,
             k=1..nops(polyvars))];

        subs2 := [v=subs(subs1, poly)];

        res := subs(subs2, res);
    od;

    res;
end;

v :=
proc(n)
option remember;
local p, k, gf;

    p := add(cat(q, k), k=1..n);
    gf := expand(pet_varinto_cind(p, pet_cycleind_cyclic(n)));

    for k to n do
        gf := coeff(gf, cat(q, k), 1);
    od;

    gf;
end;

This confirms the results of the trivial computation:

> seq([n, v(n), (n-1)!], n=1..10);
[1, 1, 1], [2, 1, 1], [3, 2, 2], [4, 6, 6], [5, 24, 24], [6, 120, 120], 
[7, 720, 720], [8, 5040, 5040], [9, 40320, 40320], [10, 362880, 362880]

A: So you have $n$ beads of $n$ colors. Just name one as "starting point" (i.e., cut the necklace on it), then you have only $n - 1$ beads to permute, i.e., $(n - 1)!$. But you can turn the necklace over, getting only half this as possible different necklaces. Thus there are:
$$
\frac{(n - 1)!}{2}
$$
necklaces.
