The following presents some commentary and some ideas. What we have
here is another instance of Power Group Enumeration as defined by
Harary and Palmer in Graphical Enumeration and also by Fripertinger
in Enumeration in Musical Theory. The scenario is always the same,
we have a row of slots with a group permuting them and a set of
objects going into these slots, with a second group permuting the
objects. We then use Burnside, indeed the Polya Enumeration Theorem
and Power Group Enumeration are both applications of this lemma. Here
the question is how we can assign objects (colors) to the slots so
they remain fixed under a given slot permutation. (We count these
assignments and average over the number of slot permutations.) With
colors only, they must be constant on the cycles of the permutation,
which is basic Burnside. With weighted objects, they must still be
constant, but each admissible assignment to a cycle of some order $q$
contributes $q$ copies of each object to the generating function. This
is PET. Finally, with a group acting on the objects as well for the
assignment to be fixed we must count the ways in which we may cover
the cycles of the slot permutation with cycles from the object
permutation by opening the cycle from the object permutation and
placing consecutive complete copies of it on the cycle from the slot
permutation. In this way when the slot / object permutation pair acts
on the assignment it merely rotates on the cycle, being fixed as
required by Burnside. This is PGE. One example of many that is
possible treats edge colorings of the cube with swappable colors and
can be found at the following MSE link
. Here is an
excerpt of the generating function that we obtain for coloring a
bracelet of twelve slots with at most four colors:
$${P_{{1}}}^{12}+35\,{P_{{1}}}^{6}{P_{{2}}}^{6}+38
\,{P_{{1}}}^{5}{P_{{2}}}^{7}+29\,{P_{{1}}}^{4}{P
_{{2}}}^{8}+297\,{P_{{1}}}^{4}{P_{{2}}}^{4}{P_{{
3}}}^{4}\\+12\,{P_{{1}}}^{3}{P_{{2}}}^{9}+1170\,{P
_{{1}}}^{3}{P_{{2}}}^{4}{P_{{3}}}^{5}+424\,{P_{{
1}}}^{3}{P_{{2}}}^{3}{P_{{3}}}^{6}+713\,{P_{{1}}
}^{3}{P_{{2}}}^{3}{P_{{3}}}^{3}{P_{{4}}}^{3}\\+6\,
{P_{{1}}}^{2}{P_{{2}}}^{10}+386\,{P_{{1}}}^{2}{P
_{{2}}}^{5}{P_{{3}}}^{5}+610\,{P_{{1}}}^{2}{P_{{
2}}}^{4}{P_{{3}}}^{6}\\+340\,{P_{{1}}}^{2}{P_{{2}}
}^{3}{P_{{3}}}^{7}+5890\,{P_{{1}}}^{2}{P_{{2}}}^
{3}{P_{{3}}}^{3}{P_{{4}}}^{4}+\ldots$$
Therefore the answer for three instances each of four colors is
$$\bbox[5px,border:2px solid #00A000]{713.}$$
The Maple code for the above is quite compact and straightforward and
follows below.
with(combinat);
with(numtheory);
pet_cycleind_cyclic :=
proc(n)
local d;
add(phi(d)*a[d]^(n/d), d in divisors(n))/n;
end;
pet_cycleind_dihedral :=
proc(n)
local s;
s := 1/2*pet_cycleind_cyclic(n);
if(type(n, odd)) then
s := s + 1/2*a[1]*a[2]^((n-1)/2);
else
s := s + 1/4*(a[1]^2*a[2]^((n-2)/2) + a[2]^(n/2));
fi;
s;
end;
pet_cycleind_symm :=
proc(n)
option remember;
local l;
if n=0 then return 1; fi;
expand(1/n*add(a[l]*pet_cycleind_symm(n-l), l=1..n));
end;
pet_indets2rep :=
proc(ip)
local rep, var, deg, pos, s;
rep := []; pos := 1;
for var in indets(ip) do
for deg to degree(ip, var) do
rep :=
[op(rep), [seq(s, s=pos..pos+op(1, var)-1)]];
pos := pos + op(1, var);
od;
od;
rep;
end;
bracelet_colorings_gf :=
proc(B, C)
option remember;
local idx_slots, idx_cols, rep, res, term_a, term_b,
v_a, v_b, inst_a, len_a, len_b, p, q,
parts, alldeg, cols, col, v;
if C = 1 then return P[1]^B fi;
if B = 1 then return P[1] fi;
idx_slots := pet_cycleind_dihedral(B);
idx_cols := pet_cycleind_symm(C);
res := 0;
for term_b in idx_cols do
rep := pet_indets2rep(term_b);
for term_a in idx_slots do
p := 1;
for v_a in indets(term_a) do
len_a := op(1, v_a);
inst_a := degree(term_a, v_a);
q := 0;
for v_b in rep do
len_b := nops(v_b);
if len_a mod len_b = 0 then
q := q + len_b*
mul(P[col], col in v_b)
^(len_a/len_b);
fi;
od;
p := p*q^inst_a;
od;
res := res +
lcoeff(term_a)*lcoeff(term_b)*p;
od;
od;
parts := 0;
for cols in expand(res) do
alldeg :=
sort(map(v -> degree(cols, v),
[op(indets(cols))]));
parts := parts +
lcoeff(cols)*
mul(P[v]^alldeg[v], v=1..nops(alldeg));
od;
parts;
end;
As a bonus we can count the colorings of a twelve-bracelet with some
number of swappable colors (at most twelve) which is a great deal
simpler and faster than working with generating functions. This is
shown below.
bracelet_pg :=
proc(B, C)
option remember;
local idx_slots, idx_colors, res, term_a, term_b,
v_a, v_b, inst_a, inst_b, len_a, len_b, p, q;
if B = 1 or C = 1 then return 1 fi;
idx_slots := pet_cycleind_dihedral(B);
idx_colors := pet_cycleind_symm(C);
res := 0;
for term_a in idx_slots do
for term_b in idx_colors do
p := 1;
for v_a in indets(term_a) do
len_a := op(1, v_a);
inst_a := degree(term_a, v_a);
q := 0;
for v_b in indets(term_b) do
len_b := op(1, v_b);
inst_b := degree(term_b, v_b);
if len_a mod len_b = 0 then
q := q + len_b*inst_b;
fi;
od;
p := p*q^inst_a;
od;
res := res +
lcoeff(term_a)*lcoeff(term_b)*p;
od;
od;
res;
end;
This gives the sequence
$$1, 122, 3960, 30108, 88508, 144587, 171283, 178190, 179204,\\
179300, 179306, 179307, 179307,\ldots$$
In particular with at most four colors we find $30108$ unique
colorings. We obtain for an exact number of colors the sequence
$$1, 121, 3838, 26148, 58400, 56079, 26696, \\
6907, 1014, 96, 6, 1, 0, \ldots$$
We get for exactly four colors that there are $26148$ unique colorings.
Note how the colorings with eleven colors can be counted by inspection
(place two markers on a twelve-bracelet).
Observe that the data for an exact number of colors are to be found at
OEIS A152176 where a considerable variety
of additional material awaits.