TOPICS

# Necklace

In the technical combinatorial sense, an -ary necklace of length is a string of characters, each of possible types. Rotation is ignored, in the sense that is equivalent to for any .

In fixed necklaces, reversal of strings is respected, so they represent circular collections of beads in which the necklace may not be picked up out of the plane (i.e., opposite orientations are not considered equivalent). The number of fixed necklaces of length composed of types of beads is given by

 (1)

where are the divisors of with , , ..., , is the number of divisors of , and is the totient function.

For free necklaces, opposite orientations (mirror images) are regarded as equivalent, so the necklace can be picked up out of the plane and flipped over. The number of such necklaces composed of beads, each of possible colors, is given by

 (2)

For and an odd prime, this simplifies to

 (3)

A table of the first few numbers of necklaces for and follows. Note that is larger than for . For , the necklace 110100 is inequivalent to its mirror image 001011, accounting for the difference of 1 between and . Similarly, the two necklaces 0010110 and 0101110 are inequivalent to their reversals, accounting for the difference of 2 between and .

 Sloane A000031 A000029 A027671 1 2 2 3 2 3 3 6 3 4 4 10 4 6 6 21 5 8 8 39 6 14 13 92 7 20 18 198 8 36 30 498 9 60 46 1219 10 108 78 3210 11 188 126 8418 12 352 224 22913 13 632 380 62415 14 1182 687 173088 15 2192 1224 481598

Ball and Coxeter (1987) consider the problem of finding the number of distinct arrangements of people in a ring such that no person has the same two neighbors two or more times. For 8 people, there are 21 such arrangements.

Antoine's Necklace, de Bruijn Sequence, Fixed, Free, Irreducible Polynomial, Josephus Problem, Lyndon Word

## Explore with Wolfram|Alpha

More things to try:

## References

Ball, W. W. R. and Coxeter, H. S. M. Mathematical Recreations and Essays, 13th ed. New York: Dover, pp. 49-50, 1987.Dudeney, H. E. Problem 275 in 536 Puzzles & Curious Problems. New York: Scribner, 1967.Gardner, M. Martin Gardner's New Mathematical Diversions from Scientific American. New York: Simon and Schuster, pp. 240-246, 1966.Gilbert, E. N. and Riordan, J. "Symmetry Types of Periodic Sequences." Illinois J. Math. 5, 657-665, 1961.Riordan, J. "The Combinatorial Significance of a Theorem of Pólya." J. SIAM 4, 232-234, 1957.Riordan, J. An Introduction to Combinatorial Analysis. New York: Wiley, p. 162, 1980.Ruskey, F. "Information on Necklaces, Lyndon Words, de Bruijn Sequences." http://www.theory.csc.uvic.ca/~cos/inf/neck/NecklaceInfo.html.Skiena, S. "Polya's Theory of Counting." §1.2.6 in Implementing Discrete Mathematics: Combinatorics and Graph Theory with Mathematica. Reading, MA: Addison-Wesley, pp. 25-26, 1990.Sloane, N. J. A. Sequences A000029/M0563, A000031/M0564, A001869/M3860, and A027671 in "The On-Line Encyclopedia of Integer Sequences."

Necklace

## Cite this as:

Weisstein, Eric W. "Necklace." From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/Necklace.html