Counting Colorful Necklaces and Bracelets in Three Colors
Dennis S. Bernstein, Omran Kouba

TL;DR
This paper derives formulas for counting non-equivalent colorful necklaces and bracelets with n beads in up to three colors, extending known sequences and providing new results for necklace counts.
Contribution
It introduces new formulas for counting colorful necklaces and bracelets under symmetry, with novel expressions for necklaces not previously documented.
Findings
Derived formulas for K(n) and K'(n)
Simplified expressions for bracelets matching OEIS sequence A114438
New formulas for counting necklaces not in OEIS
Abstract
A necklace or bracelet is \textit{colorful} if no pair of adjacent beads are the same color. In addition, two necklaces are \textit{equivalent} if one results from the other by permuting its colors, and two bracelets are \textit{equivalent} if one results from the other by either permuting its colors or reversing the order of the beads; a bracelet is thus a necklace that can be turned over. This note counts the number of non-equivalent colorful necklaces and the number of colorful bracelets formed with -beads in at most three colors. Expressions obtained for simplify expressions given by OEIS sequence A114438, while the expressions given for appear to be new and are not included in OEIS.
| 1 | 0 | 11 | 31 | 21 | 16651 | 31 | 11545611 |
| 2 | 1 | 12 | 64 | 22 | 31838 | 32 | 22371000 |
| 3 | 1 | 13 | 105 | 23 | 60787 | 33 | 43383571 |
| 4 | 2 | 14 | 202 | 24 | 116640 | 34 | 84217616 |
| 5 | 1 | 15 | 367 | 25 | 223697 | 35 | 163617805 |
| 6 | 4 | 16 | 696 | 26 | 430396 | 36 | 318150720 |
| 7 | 3 | 17 | 1285 | 27 | 828525 | 37 | 619094385 |
| 8 | 8 | 18 | 2452 | 28 | 1598228 | 38 | 1205614054 |
| 9 | 11 | 19 | 4599 | 29 | 3085465 | 39 | 2349384031 |
| 10 | 20 | 20 | 8776 | 30 | 5966000 | 40 | 4581315968 |
| 1 | 0 | 11 | 21 | 21 | 8496 | 31 | 5778267 |
| 2 | 1 | 12 | 48 | 22 | 16431 | 32 | 11201884 |
| 3 | 1 | 13 | 63 | 23 | 30735 | 33 | 21702708 |
| 4 | 2 | 14 | 133 | 24 | 59344 | 34 | 42141576 |
| 5 | 1 | 15 | 205 | 25 | 112531 | 35 | 81830748 |
| 6 | 4 | 16 | 412 | 26 | 217246 | 36 | 159140896 |
| 7 | 3 | 17 | 685 | 27 | 415628 | 37 | 309590883 |
| 8 | 8 | 18 | 1354 | 28 | 803210 | 38 | 602938099 |
| 9 | 8 | 19 | 2385 | 29 | 1545463 | 39 | 1174779397 |
| 10 | 18 | 20 | 4644 | 30 | 2991192 | 40 | 2290920128 |
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Counting Colorful Necklaces and Bracelets in Three Colors
Dennis S. Bernstein
Department of Aerospace Engineering
3020 FXB Building
1320 Beal St.
The University of Michigan
Ann Arbor, MI 48109-2140
and
Omran Kouba
Department of Mathematics
Higher Institute for Applied Sciences and Technology
P.O. Box 31983, Damascus, Syria.
Abstract.
A necklace or bracelet is colorful if no pair of adjacent beads are the same color. In addition, two necklaces are equivalent if one results from the other by permuting its colors, and two bracelets are equivalent if one results from the other by either permuting its colors or reversing the order of the beads; a bracelet is thus a necklace that can be turned over. This note counts the number of non-equivalent colorful necklaces and the number of colorful bracelets formed with -beads in at most three colors. Expressions obtained for simplify expressions given by OEIS sequence A114438, while the expressions given for appear to be new and are not included in OEIS.
keywords:
group action, Burnside’s lemma, necklace, bracelet, periodic three color sequences.
1991 Mathematics Subject Classification:
05A05.
This is a pre-print of an article published in Aequationes Mathematicæ. The final authenticated version is available online at: https://doi.org/10.1007/s00010-019-00645-w.
1. Introduction
A necklace with beads and colors is an -tuple, each of whose components can assume one of values, where not all colors need appear. Two necklaces are equivalent if one results from the other by either rotating it cyclically or permuting its colors. The classical necklace problem asks to determine the number of non-equivalent necklaces formed with beads of colors. The answer to this problem is given by
[TABLE]
where is the Euler totient function.
A bracelet with beads and colors is a necklace of beads and colors that can be turned over, and thus the order of its beads is reversed. The number of non-equivalent bracelets with beads of colors is given by
[TABLE]
where
[TABLE]
As expected, . These results and further details are given in [9, 10] and the references therein.
In this work we consider a variation on this problem that arose from considering sequences of coordinate-axis rotations defined by Euler angles, where for aircraft [1]. For this problem, it is of interest to count the number of distinct coordinate-axis rotation sequences of length that are closed in the sense of transforming the starting frame by a sequence of coordinate-axis rotations that lead back to the starting frame [2]. A pair of successive coordinate-axis rotations around the same axis can be combined into a single rotation, and the labeling of the axes of the starting frame is arbitrary. Counting the number of closed sequences consisting of coordinate-axis rotations is thus equivalent to counting necklaces in colors, where each color corresponds to an axis label. Furthermore, reversing a sequence of coordinate-axis rotations is equivalent to replacing each Euler angle in the sequence of coordinate-axis rotations by its negative. Hence, for the purpose of determining all feasible Euler angles for each closed sequence of coordinate-axis rotations, it suffices to count bracelets.
Motivated by the fact that successive coordinate-axis rotations around the same axis can be merged, the present paper considers colorful necklaces and bracelets formed with -beads of three colors, where a necklace or bracelet is colorful if no pair of adjacent beads have the same color. Two colorful necklaces are equivalent if one results from the other by permuting its colors, and two colorful bracelets are equivalent if one results from the other by either permuting its colors or reversing the order of the beads; a colorful bracelet is thus a colorful necklace that can be turned over. In fact, the number of colorful bracelets with beads in three colors appears in the On-line Encyclopedia of Integer Sequences (OEIS) as sequence A114438, which is the “Number of Barlow packings that repeat after (or a divisor of ) layers.” The provided references indicate that the problem of studying this sequence originates in crystallography [4, 5, 8].
The contribution of the present paper is twofold. First, we provide explicit formulas for the number of color bracelets that simplify those given by in [4, p. 272]. Furthermore, we provide expressions for the number of colorful necklaces with beads in three colors; this sequence is currently unknown to OEIS.
2. n-Periodic Sequences
Instead of working with necklaces and bracelets of beads we work with -periodic sequences. To fix notation, let denote the set of natural numbers from to . In particular, represents the set of the three colors under consideration.
Definition 2.1**.**
For a positive integer , a colorful -periodic sequence is a function defined on the set of integers modulo , such that for all . The set of colorful -periodic sequences is denoted by .
The set represents the colorful -bead necklaces or bracelets of three colors.
Next, we consider the permutations and on defined by and for all . The group generated by is
[TABLE]
which is isomorphic to . The group generated by is . Furthermore, since , the group generated by and is
[TABLE]
which is isomorphic to the dihedral group of order .
We also consider the symmetric group of , where consists of the identity , the three substitutions and (with representing the -cycle ), and the two -cycles and . We recall that two permutations and are conjugates if there exists a permutation such that ; this is equivalent to the fact that and have the same cyclic decomposition. Hence, for all transpositions are conjugates and all -cycles are conjugates, which can be checked directly.
The group acting on the elements of , considered as colorful -bead necklaces, is , with group action defined by for and . Similarly, the group acting on the elements of , considered as colorful -bead bracelets, is , with group action defined again by for and .
The action of on defines an equivalence relation on colorful -bead necklaces given by
[TABLE]
The set of equivalence classes of this relation is denoted by , and the desired number of non-equivalent colorful -bead necklaces is exactly . Similarly, , where is the set of equivalence classes of colorful -bead bracelets defined by the action of on .
The basic tool in this investigation is the classical Burnside’s Lemma [7, Theorem 3.22]. (While this lemma bears the name of Burnside, it seems that it was well-known to Frobenius (1887) and before him to Cauchy (1845). An account on the history of this lemma can be found in [9], see also [11]).
Theorem 2.2** (Burnside’s Lemma).**
Let be a finite group acting on a finite set . Then
[TABLE]
where is the set of elements fixed by (i.e. .)
Noting that is a subgroup of , our task is to determine the numbers
[TABLE]
with , and , where
[TABLE]
This paper is organized as follows: In Section 3, we gather some useful properties and lemmas. In Section 4 the case of necklaces is considered. Finally, in Section 5 we consider the case of bracelets.
3. Useful Properties and Lemmas
Lemma 3.1**.**
If and are positive integers, then
Proof.
This result follows from the fact that . ∎
Our first step is to determine the number of -periodic colorful sequences, that is . This is the object of the next proposition.
Proposition 3.2**.**
For all ,
[TABLE]
Proof.
Note that and . Suppose that , and define
[TABLE]
The mapping with defined by is bijective because is uniquely defined by the knowledge of and , indeed . Hence .
Also, the mapping with defined by is surjective and the pre-image of each consists of exactly two elements, namely and defined by , and . Hence . But is a partition of , so
[TABLE]
and the desired conclusion follows by induction. ∎
In particular, since the neutral element of (or ) fixes the whole set , the next corollary is immediate.
Corollary 3.3**.**
[TABLE]
Corollary 3.4**.**
For distinct , let denote the subset of consisting of functions satisfying and . Then
[TABLE]
Proof.
Given and , there is a unique permutation such that and , and with this the mapping defines a bijection between and . Thus
[TABLE]
The conclusion follows since constitutes a partition of . ∎
The next lemma helps to reduce the number of cases to be considered. The proof is immediate and left to the reader.
Lemma 3.5** (Reduction).**
Suppose that a group acts on a set , and consider two elements and from . If there is such that , then the mapping defines a bijection from onto . In particular, if and are finite and if and are conjugate elements from then .
Remark 3.6**.**
Another simple remark from group theory is that if is the direct product of two groups and , and if and are conjugate elements from , then and , (with denoting the neutral element of ), are also conjugate elements in .
With Lemma 3.5 and Remark 3.6 at hand, the next corollary is immediate:
Corollary 3.7**.**
**
- (a)
For all and all we have
[TABLE] 2. (b)
For all and all we have
[TABLE] 3. (c)
For all and all we have
[TABLE] 4. (d)
For all and all we have
[TABLE]
Proof.
Both (a) and (b) follow from the fact that all permutations of the same cycle structure are conjugate. On the other hand, since and for all , both (c) and (d) follow from Corollary 3.7. ∎
The final result in this preliminary section is a simple formula concerning sums involving Euler’s totient function (see [3, Chapter V, Section 5.5]), recall that is the number of integers in coprime to .
Lemma 3.8**.**
For every positive integer we have
[TABLE]
Proof.
If is odd then all its divisors are odd and using [3, Theorem 63], we get
[TABLE]
Now, if for some positive integer , then
[TABLE]
where we used again [3, Theorem 63]. ∎
4. Counting Colorful Necklaces
In this section we consider . According to Corollary 3.7 we need to determine , for and . The next proposition gives the answer.
Proposition 4.1**.**
**
- (a)
If then . In particular,
[TABLE]
Thus, implies . 2. (b)
- i.
Suppose that , then for all we have
[TABLE] 2. ii.
Suppose that for some positive integer , then for all we have
[TABLE]
where . 3. (c)
- i.
Suppose that , then for all we have
[TABLE] 2. ii.
Suppose that for some positive integer , then for all we have
[TABLE]
where .
Proof.
(a) A sequence satisfies , so it belongs to . Thus, by Lemma 3.1, we have
[TABLE]
The converse inclusion: is trivial, because both and are multiples of .
(b,c) i. Let be any permutation from , and suppose that so there is . From
[TABLE]
we conclude by an easy induction that for all integers we have
[TABLE]
- •
If and we have , so (4.7) implies that for all integers . But, because there is such that for some . Consequently, , or equivalently because is -periodic. This is a contradiction because neither nor has fixed points. Thus . This proves (b) .
- •
If and is odd, we have , so (4.7) implies that for all integers . But, because for some we conclude that , or equivalently . This is a contradiction because takes two different values, and has only one fixed point. Thus . This proves (c) .
(b) . Assume that and consider . From we conclude that . Thus , with . Further, if with then and consequently
[TABLE]
- •
If then (4.8) implies which is impossible since is not constant. Thus in this case.
- •
If then (4.8) shows that . Conversely, it is easy to check that any belongs to . Thus, we have shown that
[TABLE]
Now, when belongs to it is completely determined by its restriction to , and the mapping (see Figure 1):
[TABLE]
where is the unique sequence from which coincides with on , is a bijection.
We conclude, according to Corollary 3.4 that
[TABLE]
- •
If , then a similar argument to the previous one (with replaced by ), yields the desired conclusion. This completes the proof of (b) .
(c) . For simplicity we write for . Suppose that and consider . We have
[TABLE]
Hence and consequently , this implies that where . Now write with , then and consequently
[TABLE]
- •
If , then (4.11) implies which is impossible since is not constant. Thus in this case.
- •
If , then (4.11) implies , that is . Conversely, it is easy to check that any belongs to . Thus, we have shown that in this case
[TABLE]
Clearly, if then consists exactly of two elements: namely , defined by , and . So,
[TABLE]
Now suppose that . Any is completely determined its restriction to (note that should be different from and ,) so considering the different possibilities for we see that the mapping , (see Figure 2):
[TABLE]
where is the unique sequence from that coincides with on , is a bijection.
Thus, according to Corollary 3.4, we have
[TABLE]
This concludes the proof of (c) , in view of (4.12). ∎
The final step is to put all the pieces together to get the expression of in terms of using Burnside’s Lemma.
Theorem 4.2**.**
The number of non-equivalent colorful -bead necklaces with three colors is given by
[TABLE]
where is the indicator function of the set , ( i.e. if and if ,) and is the largest power of dividing .
Proof.
According to Corollary 3.7 and Burnside’s Lemma 2.2 we have
[TABLE]
with
[TABLE]
Using part (a) of Proposition 4.1 we have
[TABLE]
Thus, using the expression of from Proposition 3.2, we get
[TABLE]
Similarly, according part (c) of Proposition 4.1 we know that if is odd, while we have the following when :
[TABLE]
Finally we get
[TABLE]
Now, we come to . According to part (b) of Proposition 4.1 we know that if is not a multiple of while if we have
[TABLE]
Thus,
[TABLE]
Replacing (4.19), (4.20) and (4.21) in (4.15) we get
[TABLE]
with
[TABLE]
and
[TABLE]
In order to reduce a little bit the expression of we use Lemma 3.8. Indeed, Suppose that where is the exponent of in the prime factorization of , thus . Clearly if then using Lemma 3.8 we get
[TABLE]
Now if then
[TABLE]
Finally, noting that , we obtain the following formula for which is also valid when according to (4.25):
[TABLE]
Now note that can be written ans follows
[TABLE]
with
[TABLE]
where
[TABLE]
equivalently
[TABLE]
Thus
[TABLE]
So, we may write in the following form
[TABLE]
with defined by
[TABLE]
This can also be written in the form , and the announced expression (4.13) for is obtained. Finally, the formula , follows from the fact that. . ∎
We conclude our discussion of the case of necklaces by noting that there are some simple cases where the formula for is particularly appealing, for example, if is prime, then
[TABLE]
and if , then
[TABLE]
Remark 4.3**.**
If and are coprime, then is related to the number of -bead necklaces of two colors (1.1) by the formula
[TABLE]
Remark 4.4**.**
An equivalent formula for that does not use the indicator function of the set is the following
[TABLE]
Table 1 lists the first 40 terms of the sequence .
5. Counting Colorful Bracelets
As we explained before, bracelets are turnover necklaces. It is the action of the group on the set of -periodic colorful sequences that is considered.
We are interested in the number of orbits denoted by . Again Burnside’s Lemma comes to our rescue. We need to determine the numbers with , and , but we have already done this in the case in the previous section.
Further, based Corollary 3.7, we only need to determine and for in . This is the object of the next proposition.
Proposition 5.1**.**
**
-
(a)
-
i.
If is odd then , otherwise . 2. ii.
. 2. (b)
- i.
** 2. ii.
** 3. (c)
**
Proof.
(a) Suppose that and consider . Write with . Because for every , we conclude by considering that . But so we must have and . Now, from the fact that for every we conclude that
[TABLE]
So, the mapping
[TABLE]
defines a bijection between and the set
[TABLE]
Now, may take any one of three possible values and each other has two possible values. So, the cardinality of this set is . Thus (a) i. is proved.
Now suppose that and consider from . We have for every , in particular, for we get which is absurd, and (a) ii. follows.
(b) i. we write for . Suppose that and consider . We have
[TABLE]
Taking we get , and this implies that .
- •
If then and consequently . The restriction of to the period has the form
[TABLE]
So, is completely determined by the knowledge of and consequently there is a bijection between and . Thus, by Corollary 3.4, we have
[TABLE]
- •
If , then and consequently . The restriction of to the period takes the form
[TABLE]
So, is completely determined by the knowledge of and consequently there is a bijection between and . Thus
[TABLE]
(b) ii. Now suppose that and consider . We have
[TABLE]
Taking we get , but thus .
- •
If , then but thus . The restriction of to the period takes the form
[TABLE]
So, is completely determined by the knowledge of . We can partition the set according to the values taken by , and we have obvious bijective mappings:
[TABLE]
Thus
[TABLE]
- •
If then and consequently . The restriction of to the set takes the form
[TABLE]
So, is completely determined by the knowledge of and there is an obvious bijective mapping between and . Thus
[TABLE]
This concludes the proof of part (b).
(c) First, suppose that and consider . We have for all . In particular, which is absurd because has no fixed points.
Next suppose that and consider . We have for all .
- •
If then
[TABLE]
which is absurd because has no fixed points.
- •
If then
[TABLE]
which is also absurd because has no fixed points.
This achieves the proof of the proposition. ∎
Finally we arrive to the main theorem of this section.
Theorem 5.2**.**
The number of non-equivalent colorful -bead Bracelets with three colors is given by
[TABLE]
with
[TABLE]
where is given by Theorem 4.2.
Proof.
We only need to put things together. We know that
[TABLE]
Thus with
[TABLE]
where we used Corollary 3.7. Now using Proposition 5.1 we get
[TABLE]
and
[TABLE]
Replacing in the expression of we obtain
[TABLE]
and the announced result follows. ∎
Table 2 lists the first 40 terms of the sequence .
Remark 5.3**.**
Although for all a surprising fact about and is that they coincide for the first values!.
Remark 5.4**.**
The equality and the easy-to-prove fact that for , allow us to find the parity pattern of the ’s. The fact that for seems difficult to prove directly.
6. Related Combinatorial Sequences
Colorful necklaces or bracelets with beads and two colors are easy to determine. There are none when is odd and just one equivalence class when is even. Thus the sequences and defined by
[TABLE]
represent the number of non-equivalent colorful necklaces in beads with exactly colors and the number of non-equivalent colorful bracelets in beads with exactly colors, respectively. Both sequences , and are currently not recognized by the OEIS.
Further, if we are interested in periodic colorful sequences of exact period in at most colors then the number of non-equivalent such sequences assuming that reversing is not allowed is given by
[TABLE]
where is the well known Moebius function. Indeed, this follows from the classical result [6, Theorem 1.5], because clearly .
OEIS recognizes as the “Number of Zn S polytypes that repeat after layers” A011957.
Similarly, if we are interested in periodic colorful sequences of exact period in at most colors then the number of non-equivalent such sequences assuming that reversing is allowed is given by
[TABLE]
OEIS recognizes as the “Number of Barlow packings that repeat after exactly layers” A011768.
7. Future Research
This paper has counted non-equivalent colorful necklaces and non-equivalent colorful bracelets in beads with colors. An open problem is to count non-equivalent colorful necklaces and colorful bracelets in beads with colors.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] Bernstein, D.S.: On Feasible Body, Aerodynamic, and Navigation Euler Angles for Aircraft Flight, Submitted (2018)
- 2[2] Bhat, S., Crasta, N.: Closed rotation sequences, Discrete Comput. Geom. 53 ,2, 366–396 (2015)
- 3[3] Hardy, G.H., Wright, E.M.: An Introduction to the theory of numbers, Sixth edition, Oxford University Press, Oxford, 2008
- 4[4] Mc Larnan, T.J.: The numbers of polytypes in close-packings and related structures, Z. Kristallogr. Cryst. Mater. 155 , 269–291, (1981)
- 5[5] Estevez-Rams, E., Azanza-Ricardo, C., García, M., Aragón-Fernández, B.: On the algebra of binary codes representing close-packed stacking sequences, Acta Cryst. A 61 , 201–208, (2005)
- 6[6] Rose, H. E.: A Course in Number Theory, Oxford Science Publications, Clarendon Press, Oxford, 1988
- 7[7] Rotman, J.J.: An Introduction to the Theory of Groups, Fourth edition, Graduate Texts in Mathematics 148, Springer-Verlag New York, 1995
- 8[8] Thompson, R.M., Downs, R.T.: Systematic generation of all nonequivalent closest-packed stacking sequences of length N 𝑁 N using group theory, Acta Cryst. B 57 , 766–771, (2001)
