Function Repository Resource:

NecklaceCount

Count the number of distinct necklaces made with beads of different colors

Contributed by: Wolfram Staff (original content by Sriram V. Pemmaraju and Steven S. Skiena)
 ResourceFunction["NecklaceCount"][group,n] gives the number of distinct necklaces that can be constructed with beads of n colors using operations defined by group.

Details and Options

ResourceFunction["NecklaceCount"] uses the Pólya enumeration theorem.
Possible values of group are CyclicGroup[n] and , with positive integer values of the number of beads n.
Two necklace colorings are assumed to be equivalent if one can be obtained from the other by a rotation for the cyclic group and rotation or flip for the dihedral group .
Necklaces produced by the cyclic group are also called "fixed necklaces" to distinguish them from "turnover necklaces" or "bracelets" produced by the dihedral group.

Examples

Basic Examples (2)

The number of distinct (fixed) necklaces of six beads in three colors:

 In[1]:=
 Out[1]=

The number of bracelets of five beads in two colors:

 In[2]:=
 Out[2]=

Properties and Relations (2)

The necklace count can be obtained from CycleIndexPolynomial for the corresponding group:

 In[3]:=
 Out[3]=
 In[4]:=
 Out[4]=
 In[5]:=
 Out[5]=

Or for a bracelet:

 In[6]:=
 Out[6]=
 In[7]:=
 Out[7]=

Version History

• 1.0.0 – 23 June 2020