Counting Circles

Here’s one of my favorite problems: How many ways are there to arrange 3 red marbles and 2 blue marbles into a circle?

1. Intro to combinatorics

Let’s start with something simpler: Arranging the same marbles into a sequence.
Imagine 5 empty boxes with numbers from 1 to 5 written on them. The ways of arranging the 3 red and 2 blue marbles into a sequence correspond one-to-one to the ways to put them (one each) into these boxes.
We’ll do that by first placing all the red ones and then the blue ones. For the first one, we have 5 possible boxes to put it into; For the second one, there are only 4 left and for the third one there are 3 choices. After that, the rest of the boxes has to be filled with blue marbles.

You might be inclined to say that the answer must thus be 5×4×3, but that’s not quite right because the red marbles are indistinguishable from each other. For example, placing the first red marble into box 1 and the second one into box 2 results in the same thing as placing the first one into box 2 and the second one into box 1.

But what if they were distinguishable? Say we write numbers onto the red marbles. The exact numbers don’t really matter (only that no two red marbles have the same number), but let’s just go with 1, 2, and 3. Simple and easy.
Now that we’ve numbered them, the number of ways to place these three marbles into 5 boxes is actually 5×4×3.

But consider such a placement with the numbered marbles already in the boxes. We could also have got there by placing our original, indistinguishable marbles into the boxes first and then writing the numbers onto them.
Let’s do that in order: For each possible placement of the indistinguishable marbles, there are 3 possible choices for the number 1, then 2 possible choices for the number 2, then the final number 3 has to be the remaining one.
Thus, the total number of ways to write the numbers 1, 2, 3 onto the three marbles is 3×2×1=6.

So, if we call the number of ways to place 3 indistinguishable marbles into 5 numbered boxes 𝑁, we know that the number of ways to place 3 distinguishable marbles into the same boxes is 6×𝑁.
But from before, we also know that this number must be equal to 5×4×3, so we can deduce that6×𝑁=5×4×3𝑁=5×4×36=10.Let’s clean this up a bit with some notation:

So, using this, we can write𝑁=53̲3!.This number 𝑁 is also called a binomial coefficient, or “5 choose 3”. There are varying notations for it, but I’ll go with𝑁=𝐶(5,3).Note that nothing in this argument actually relied on any properties of the numbers 3 and 5, so, in general, the number of ways to put 𝑘 red and (𝑛𝑘) blue marbles into a sequence is𝐶(𝑛,𝑘)=𝑛𝑘̲𝑘!.

By the way, here’s the list of possible sequences: RRRBB, RRBRB, RRBBR, RBRRB, RBRBR, RBBRR, BRRRB, BRRBR, BRBRR, BBRRR.
We can be sure that that’s all of them by just confirming that there’re no duplicates and that there’s really 10 of them.

2. Counting with Symmetry

That was for a sequence of marbles, but what about a row of them?

You might say “that’s the same”, but the difference is that a row has reflection symmetry.
In particular, imagine a row of marbles lying on the ground. You can just look at them from the opposite side and thus swap what you see as the left and right end, but the row is still the same.

So, in general, there are up to two sequences corresponding to any given row. For example, the sequences RRBBR and RBBRR are the same row because they’re just mirror images of each other.

But it gets more complicated when you consider RBRBR. This row is a palindrome, meaning it is its own mirror image. The existence of rows like that means we can’t just divide by two to go from the number of sequences to the number of rows.

But we can split the sequences into palindromes and non-palindromes. Then, each palindrome counts as one row and each non-palindrome counts as half a row. So, 𝑃 being the number of palindromes and 𝑃̄ being the number of non-palindromes, we’d have𝑁row=𝑃+12𝑃̄=12(𝑃+𝑃+𝑃̄)=12(𝑃+𝑁seq),where 𝑁seq=𝐶(5,3) is the number of sequences.

So how many palindromes are there?
Since we have an even number of blue and an odd number of red marbles, the marble in the middle must be red.
The remaining four marbles are split into a left and right half and the right half must be the mirror image of the left half. So we are free to choose the left half, but that’s it. In other words, our freedom of choice corresponds to placing one blue and one red marble into a sequence:𝑃=𝐶(2,1).

So the total comes out to𝑁row=12[𝐶(2,1)+𝐶(5,3)]=6.Here’s the list:

Generalizing this is somewhat easy, but depends on the parity of 𝑛 and 𝑘.

I’ll use the Iverson Bracket to unify these three cases. Its definition is that 𝜑=1 if 𝜑 is true and 𝜑=0 if 𝜑 is false.

So the general formula for 𝑃 is𝑃=𝑛odd or𝑘even𝐶(𝑛2,𝑘2).

Thus, the general formula for the number of ways to place 𝑘 red marbles and (𝑛𝑘) blue marbles into a row is𝑁row=12[𝐶(𝑛,𝑘)+𝑛odd or𝑘even𝐶(𝑛2,𝑘2)].

3. Group Theory

The general study of symmetries as part of abstract algebra is called group theory.

I’ll introduce the parts of it we will need in a sort-of unconventional way.

To start with, consider the idea of a symmetry transformation. The most well-known symmetry transformations are reflections and rotations.
Something is symmetric if it stays the same after performing some symmetry transformation.

To get to a general definition of symmetry transformations, one can think long and hard about what reflections and rotations have in common, but I’ll cut it short here and just tell you that the deciding property is invertibility.

You might be a bit confused since, if something is symmetric, you already end up with what you started with after performing one symmetry transformation, but the important thing is that the description of invertibility also holds for non-symmetric things.
For example, reversing the letters in a palindrome like “wow” results in the same word, but for a non-palindrome like “word”, you get “drow”, and only after performing the inverse transformation (in this case “reversing again”), you end up back where you started.

Now let’s think about formalizing this using the example of the minute hand on a special clock. The clock isn’t really useful for telling the time; It is basically a circular image with a singular hand on top of it.

The reason for this example over just a regular clock is that it gives us a reason to call rotating the hand a symmetry operation. Namely, if the image behind the hand has some rotational symmetry, for example if it’s the image of a playing card with 180° rotational symmetry, then rotating the hand by that amount is basically the same as rotating the entire clock by that amount, which means that the clock hasn’t really changed. 2

In math, basically everything we deal with is a set, so we need a set 𝑋 to perform symmetry operations on. In particular, the elements of 𝑋 will be the input/output states of the symmetry operations, so that we can model the operations themselves as functions 𝑋𝑋.

In our example, the symmetry operations are rotations of the hand, so the input/output states of that can be taken to just be the position of the hand on the clock, which can be modeled as an angle measured in degrees, so a real number in the interval [0,360).

Then, as stated before, symmetry transformations need to be invertible, so we’re looking at the invertible functions (aka. “bijections”) from 𝑋 to 𝑋.
The set of those bijections will be denoted 𝑆(𝑋) here; It underlies what’s called the symmetric group of 𝑋.

I won’t define the term “group” in general, since it’s more abstract than we need. Instead, we’ll be working with subgroups of 𝑆(𝑋), which are defined as a subset 𝐺 of 𝑆(𝑋) such that

  1. For any functions 𝑓,𝑔𝐺, the composition 𝑓𝑔 is also in 𝐺.

  2. For any function 𝑓𝐺, the inverse 𝑓1 is also in 𝐺.

Note that a combination of the two requirements implies 𝑓𝑓1=id𝐺, so a subgroup of 𝑆(𝑋) always contains the identity function.

These conditions basically mean that 𝐺 is a “self-contained” set of symmetry operations. For example:

Now we can recontextualize the previous section: We had a set 𝑋 of sequences of 3 red and 2 blue marbles and a subgroup 𝐺={id,𝑠} of 𝑆(𝑋), where 𝑠 is the function that reverses a sequence. The conditions are easily confirmed:

  1. For any 𝑓𝐺, 𝑓id=𝑓𝐺 and id𝑓=𝑓𝐺. Additionally, 𝑠𝑠=id𝐺.

  2. id1=id𝐺 and 𝑠1=𝑠𝐺.

4. Burnside’s Lemma

We’re close to the payoff of all that group theory.

First, we need another definition: Given a set 𝑋 and a subgroup 𝐺 of 𝑆(𝑋),

In Section 2, the orbits corresponded to the rows of marbles: For a sequence 𝑥 of marbles, we had [𝑥]𝐺={𝑥,𝑠(𝑥)}. For non-palindromes, this set has two elements; For palindromes, 𝑠(𝑥)=𝑥 by definition.

In general, our problem becomes finding the number of orbits, i.e. |𝑋/𝐺|.

This is solved by something called Burnside’s Lemma, which states that|𝑋/𝐺|=1|𝐺|𝑓𝐺|fix𝑋(𝑓)|.

For a small example, recall 𝐺={id,𝑠} from Section 2. For this, the formula becomes|𝑋/𝐺|=12(|fix𝑋(id)|+|fix𝑋(𝑠)|),where fix𝑋(id)=𝑋 and fix𝑋(𝑠) is the set of palindromes. Setting 𝑁seq=|𝑋| and 𝑃=|fix𝑋(𝑠)|, we can see that this is exactly the formula we had arrived at:|𝑋/𝐺|=12(𝑁seq+𝑃).

4.1. Proof

The following is a proof of Burnside’s Lemma, adapted from Wikipedia. 3

Start with the right-hand side and notice that𝑓𝐺|fix𝑋(𝑓)|=𝑓𝐺|{𝑥𝑋|𝑓(𝑥)=𝑥}|=|{(𝑓,𝑥)𝐺×𝑋|𝑓(𝑥)=𝑥}|=𝑥𝑋|{𝑓𝐺|𝑓(𝑥)=𝑥}|=𝑥𝑋|[id]𝑥|,where we have defined[𝑔]𝑥{𝑓𝐺|𝑓(𝑥)=𝑔(𝑥)}for any 𝑔𝐺.

Note that this partitions 𝐺, which is proven as follows: Consider the set[𝑔]𝑥[]𝑥={𝑓𝐺|𝑓(𝑥)=𝑔(𝑥)and𝑓(𝑥)=(𝑥)}.Either 𝑔(𝑥)=(𝑥) and [𝑔]𝑥=[]𝑥, or 𝑔(𝑥)(𝑥) and [𝑔]𝑥[]𝑥=.

Next, for any 𝑔𝐺, consider the precomposition map 𝑔:𝐺𝐺 defined by 𝑔(𝑓)𝑔𝑓. It is a bijection with inverse (𝑔1). This implies that, for any set 𝐻𝐺,|{𝑔(𝑓)|𝑓𝐻}|=|𝐻|.

In particular, let 𝐻=[id]𝑥, then we have proven that, for any 𝑔𝐺,|[id]𝑥|=|{𝑔(𝑓)|𝑓[id]𝑥}|=|{𝑔𝑓|𝑓[id]𝑥}|=|{|𝑔1[id]𝑥}|.Now note that𝑔1[id]𝑥𝑔1((𝑥))=𝑥(𝑥)=𝑔(𝑥),which implies|[id]𝑥|=|{|(𝑥)=𝑔(𝑥)}|=|[𝑔]𝑥|.Recall that this holds for all 𝑔𝐺.

Now we want to find the number of distinct sets [𝑔]𝑥. This is easily done by noticing that there is a bijection between [𝑔]𝑥 and 𝑔(𝑥): Each [𝑔]𝑥 uniquely defines 𝑔(𝑥) and each 𝑎=𝑔(𝑥) uniquely defines [𝑔]𝑥={𝑓𝐺|𝑓(𝑥)=𝑎}.
Thus, the number of distinct sets [𝑔]𝑥 is equal to the number of distinct values 𝑔(𝑥), i.e.|{𝑔(𝑥)|𝑔𝐺}|=|[𝑥]𝐺|.

Since 𝐺 is partitioned into the [𝑔]𝑥, which all have the same size |[𝑔]𝑥|=|[id]𝑥|, and there are |[𝑥]𝐺| of them, it follows that the cardinality of 𝐺 satisfies|𝐺|=|[𝑥]𝐺||[id]𝑥|.

Now recall the sum from the start and apply this:𝑓𝐺|fix𝑋(𝑓)|=𝑥𝑋|[id]𝑥|=𝑥𝑋|𝐺|/|[𝑥]𝐺|.Split the sum over 𝑋 along the orbits 𝑂𝑋/𝐺, noting that 𝑥𝑂 implies [𝑥]𝐺=𝑂,𝑓𝐺|fix𝑋(𝑓)|=𝑥𝑋|𝐺|/|[𝑥]𝐺|=𝑂𝑋/𝐺𝑥𝑂|𝐺|/|[𝑥]𝐺|=𝑂𝑋/𝐺𝑥𝑂|𝐺|/|𝑂|=𝑂𝑋/𝐺|𝐺|=|𝑋/𝐺||𝐺|.This immediately implies|𝑋/𝐺|=1|𝐺|𝑓𝐺|fix𝑋(𝑓)|.Q.E.D.

5. Counting Circular Configurations

Now we’re technically ready to answer the original question of arranging 3 red and 2 blue marbles into a circle, but let’s warm up with a slightly easier one: “How many ways are there to arrange 5 marbles, any of which may be red or blue, into a circle?”

Restating this question into more formal language, we’re asking about the number of orbits, |𝑌/𝐺|, where 𝑌 is the set of 5-long sequences of red and blue marbles, and 𝐺 is one of two subgroups of 𝑆(𝑌):

  1. The symmetry transformations that correspond to rotations of the circle. Since we encode the “circle” as a sequence, this means that these are functions that split the sequence into two contiguous subsequences and put those back together in the opposite order. For example, “ABCDE → CDEAB” or “ABCDE → EABCD”.
    In the jargon, this is called the cyclic group of order 5.

  2. All of the previous transformations, together with reflections across either an element or a gap between elements. The number of these reflections is also equal to 5. (And in general equal to the number of elements in the sequence).
    In the jargon, this is called the dihedral group of order 10.

Call these 𝐺1 and 𝐺2.

All of these symmetry transformations can be generated from two basic elements:

In the first case, we can reach each of the possible transformations by applying 𝑟 some number of times: 𝑟0=id,𝑟1=𝑟,𝑟2,𝑟3,𝑟4. Applying 𝑟 5 times always leaves the input untouched (𝑟5=id), so 𝑟1=𝑟4.

In the second case, we have the same thing with 𝑟, and the reflections are all of the form 𝑟𝑘𝑠𝑟𝑘, which should make intuitive sense: To reflect across some arbitrary axis, first rotate such that that axis moves to a standard position, then perform the standard reflection, then rotate back.

The first answer is then|𝑌/𝐺1|=15𝑘=04|fix𝑌(𝑟𝑘)|.We still need to find fix𝑌(𝑟𝑘), but since |fix𝑌(𝑓)|=|fix𝑌(𝑓1)|, 𝑟4=(𝑟1)1 and 𝑟3=(𝑟2)1, we only need to find this for 𝑘=0, 𝑘=1, and 𝑘=2.

This implies that|𝑌/𝐺1|=15𝑘=04|fix𝑌(𝑟𝑘)|=15(32+42)=8.

The second answer is found similarly, by also considering |fix𝑌(𝑟𝑘𝑠𝑟𝑘)| for 𝑘=04.
This is even easier because all of those reflections are just rotations of each other, so their fixpoint sets have to be rotations of each other and in particular have to be the same size. Thus, we only need to find |fix𝑌(𝑠)|.

This implies that|𝑌/𝐺2|=110𝑘=04(|fix𝑌(𝑟𝑘)|+|fix𝑌(𝑟𝑘𝑠𝑟𝑘)|)=110(32+42+58)=8,meaning that the 𝐺1-orbits of 𝑌 are already reflection-symmetric.

We can now find a general formula that gives the number of ways to arrange 𝑛 marbles, each red or blue, into a circle.

First of all, some caution is highly necessary with the definition of 𝐺2. To rotate the axis of mirror symmetry by 𝑟𝑘, you use the formula 𝑟𝑘𝑠𝑟𝑘, but for even 𝑛, this only reaches half of the possible symmetry axes: Since 𝑠 mirrors across an axis that doesn’t touch any marbles, all of its rotations by 𝑟𝑘 will also only mirror across such an axis.
In this case, we also need rotations of 𝑠 by 𝑟2𝑘+12, which are the missing reflections across axes that each go through two marbles. Strictly speaking, 𝑟2𝑘+12 isn’t defined in 𝐺2, but we can save ourselves by noting that𝑟𝑘𝑠𝑟𝑘=𝑟2𝑘𝑠for all 𝑘, so if we set 𝑘2𝑘+12, we get that these reflections are given by𝑟2𝑘+1𝑠.This means that we should work with the definition {𝑟𝑘𝑠|𝑘} for the set of reflections, which always works, including when 𝑛 is even.

Now let 𝑌 be the set of sequences of 𝑛 marbles, each red or blue. We now index these sequences starting at zero to keep the logic a bit simpler.

For the answers, this gives us|𝑌/𝐺1|=1𝑛𝑘=0𝑛1|fix𝑌(𝑟𝑘)|=1𝑛𝑘=0𝑛12gcd(𝑘,𝑛)=1𝑛𝑑𝑛|{𝑘{0,,𝑛1}|gcd(𝑘,𝑛)=𝑑}|2𝑑,|𝑌/𝐺2|=12𝑛𝑘=0𝑛1(|fix𝑌(𝑟𝑘)|+|fix𝑌(𝑟𝑘𝑠)|)=12(|𝑌/𝐺1|+2𝑛2+𝑛even and𝑘odd).There’s a special case to look out for: If 𝑛=2, then 𝑟=𝑠, so the 𝐺2 formula breaks down, but that’s fine, since the 𝐺1 formula already respects all the wanted symmetries included in this case.
Thus, let the second formula require 𝑛3.5

The 𝐺1 formula can be simplified a bit further:
We find |{𝑘{0,,𝑛1}|gcd(𝑘,𝑛)=𝑑}| by first noting that the set being measured is a subset of {𝑘{0,,𝑛1} :𝑑gcd(𝑘,𝑛)}. Then note that 𝑑𝑛 is a given, so 𝑑gcd(𝑘,𝑛)𝑑𝑘, so the second set is just {𝑘{0,,𝑛1} :𝑑𝑘}, i.e. the set of multiples of 𝑑 below 𝑛.
All of these take the form 𝑑 and the condition on can be read off from𝑑<𝑛<𝑛𝑑.Thus, we find that|{𝑘{0,,𝑛1}|gcd(𝑘,𝑛)=𝑑}|=|{{0,,𝑛𝑑1}|gcd(𝑑,𝑛)=𝑑}|=|{{0,,𝑛𝑑1}|gcd(,𝑛𝑑)=1}|=𝜑(𝑛𝑑),where 𝜑 is Euler’s totient function and the last equality is by its definition.

This gives us|𝑌/𝐺1|=1𝑛𝑑𝑛𝜑(𝑛𝑑)2𝑑.

More concretely, we have𝜑(𝑚)=𝑚(11𝑝),where the product is over primes 𝑝 dividing 𝑚.

We thus use the prime factorization 𝑛=𝑖=1𝑚𝑝𝑖𝑘𝑖, where (𝑝𝑖)𝑖=1𝑚 is some finite sequence of prime numbers and (𝑘𝑖)𝑖=1𝑚 some finite sequence of positive integers.
Then, the sum over the divisors of 𝑛 splits into 𝑚 sums over the exponents of the 𝑝𝑖:|𝑌/𝐺1|=1𝑛𝑎1=0𝑘1𝑎𝑚=0𝑘𝑚𝜑(𝑖=1𝑚𝑝𝑖𝑘𝑖𝑎𝑖)2𝑖=1𝑚𝑝𝑖𝑎𝑖=1𝑛𝑎1=0𝑘1𝑎𝑚=0𝑘𝑚𝑖=1𝑚(𝑝𝑖𝑘𝑖𝑎𝑖(1𝑎𝑖<𝑘𝑖1𝑝𝑖))2𝑖=1𝑚𝑝𝑖𝑎𝑖=1𝑛𝑎1=0𝑘1𝑎𝑚=0𝑘𝑚𝑖=1𝑚((𝑝𝑖𝑎𝑖<𝑘𝑖)𝑝𝑖𝑘𝑖𝑎𝑖1)2𝑖=1𝑚𝑝𝑖𝑎𝑖.

As a nice example with applications to music theory, let’s take 𝑛=12. In western music theory, it’s typical to work with 12-tone equal temperament, which is a tuning system with 12 notes per octave. Notes an octave apart are considered the same note, so we’re effectively working with a circle with 12 elements.

A scale can then be defined as any subset of these 12 notes. It corresponds to an arrangement of 12 marbles, each red or blue, into a circle: Just take a red marble for all notes that aren’t in the subset and a blue one for those that are.

Different scales related to each other by rotation of the circle are called modes of each other, and the reflection of a scale across a certain axis is called its inversion.

This means that counting the number of different scales, considering modes and/or inversions to be the same scale, can be done with our two formulae. Concretely, 12=2231, so there are|𝑌/𝐺1|=112𝑎=02𝑏=01((2𝑎<2)22𝑎1)((3𝑏<1)31𝑏1)22𝑎3𝑏=112((8+16)+(8+64)+(32+4096))=352.scales when considering different modes as the same scale.

Further, when also considering inversions as the same scale, the number drops to|𝑌/𝐺2|=12(|𝑌/𝐺1|+2122)=12(352+64)=208.

5.1. Final Answer

Let’s directly start with the general form of the original question: How many ways are there to arrange 𝑘 red and (𝑛𝑘) blue marbles into a circle?

Again, we have 𝑋, the set of sequences of 𝑘 red and (𝑛𝑘) blue marbles and 𝐺1 and 𝐺2 like before.

For the fixpoint set sizes, we can reuse some of the logic from the previous section:

Thus, we get|𝑋/𝐺1|=1𝑛𝑎=0𝑛1𝑛 /gcd(𝑎,𝑛)𝑘𝐶(gcd(𝑎,𝑛),𝑘𝑛gcd(𝑎,𝑛))=1𝑛𝑑𝑛|{𝑎{0,,𝑛1}|gcd(𝑎,𝑛)=𝑑}|𝑛𝑑𝑘𝐶(𝑑,𝑘𝑛𝑑)=1𝑛𝑑𝑛𝑛𝑑𝑘𝜑(𝑛𝑑)𝐶(𝑑,𝑘𝑛𝑑),=1𝑛𝑑𝑛𝑑𝑘𝜑(𝑑)𝐶(𝑛𝑑,𝑘𝑑)=1𝑛𝑑gcd(𝑘,𝑛)𝜑(𝑑)𝐶(𝑛𝑑,𝑘𝑑),|𝑋/𝐺2|=12(|𝑋/𝐺1|+1𝑛𝑎=0𝑛1|fix𝑋(𝑟𝑎𝑠)|)=12(|𝑋/𝐺1|+𝐶(𝑛2𝑛even and𝑘odd,𝑘2)).

Concretely, for the introductory example (𝑛=5,𝑘=3), this gives|𝑋/𝐺1|=15𝜑(1)𝐶(5,3)=105=2,|𝑋/𝐺2|=12(2+𝐶(2,1))=12(2+2)=2.Concretely, these orbits are {RRRBB, RRBBR, RBBRR, BBRRR, BRRRB} and {RRBRB, RBRBR, BRBRR, RBRRB, BRRBR}.

Finally, this problem also has an application in music theory, when considering a more conservative definition of a scale: Here, a scale is defined by an arrangement of 5 whole steps and 2 half steps into a circle. This lets us apply the formula with 𝑛=7 and 𝑘=2, which gives|𝑋/𝐺1|=17𝜑(1)𝐶(7,2)=217=3,|𝑋/𝐺2|=12(3+𝐶(3,1))=12(3+3)=3.Concretely, these orbits are

The last of them corresponds to the well-known modes of the major/minor scale:

The second-to-last of them corresponds to the modes of the also somewhat well-known melodic minor scale, WHWWWWH. The mode HWHWWWW is also known as the superlocrian scale.

Alternatively, we can also use the formula to find the size of specific subsets of the set of scales (now using the previous 12-based definition again). For example, the numbers of 7-tone scales are|𝑋/𝐺1|=112𝜑(1)𝐶(12,7)=66,|𝑋/𝐺2|=12(66+𝐶(5,3))=38.That’s already way more than the measly 3 we got above.

6. Conclusion

This has been a journey from a simple-sounding question to combinatorics, group theory, back to combinatorics with Burnside’s Lemma, and finally to the answer of that question.

There are lots of related questions I didn’t bring up here, such as considering more than two colors for the marbles, or asking about the size of more specific subsets, but if you followed along well, you’re probably equipped to answer those on your own now.

Most of all, I hope you had fun with this. I certainly did.

  1. 1 Proof: WLoG let 𝑘 be odd, then𝐶(𝑛2,𝑛𝑘2)=𝐶(𝑛12,𝑛𝑘2)=𝐶(𝑛12,𝑛12𝑘12)=𝐶(𝑛12,𝑘12)=𝐶(𝑛2,𝑘2),where step used the reflection formula (archived). ↩︎
  2. 2 I didn’t want to choose just rotating something in space as the example because that already invites the objection that that’s not an “operation”, because our brains already model object permanence in a way that respects spatial symmetries. ↩︎
  3. 3 This proof also includes the proofs of special cases of Lagrange’s theorem and the orbit-stabilizer theorem, since I don’t want to presuppose them and we won’t be needing them by name. ↩︎
  4. 4 This can also be defined as 𝑑%𝑛𝑑𝑛𝑑𝑛↩︎
  5. 5 𝑛=1 and 𝑛=0 are totally useless and we can just ignore them. ↩︎
  6. 6 The common divisors of 𝑘 and 𝑛𝑘 are the same as those of 𝑘 and 𝑛, so 𝑛 /gcd(𝑎,𝑛) divides both 𝑘 and 𝑛𝑘 if and only if it divides both 𝑘 and 𝑛. But it always divides 𝑛 since 𝑛=gcd(𝑎,𝑛)(𝑛 /gcd(𝑎,𝑛)), so it only has to divide 𝑘↩︎