AI proved a math conjecture I made when I was an undergraduate
The problem
Given positive integers and with , consider balls labelled . Color them subject to the following rules:
- Balls and have the same color.
- Balls and have the same color whenever .
What is the maximum possible number of colors?
I recently rediscovered this problem in my undergraduate notes. I proposed this problem “inspired by a homework problem in my discrete mathematics class.” At the time, I experimentally found what appeared to be the answer, but I never managed to prove it rigorously. Years later, I gave the problem to an AI, which revealed the simple algebraic structure behind the conjecture.
My original observation
Let denote the answer. From small examples, I observed the recurrence
This resembles the Euclidean algorithm, so I conjectured that the answer depends only on . More precisely, if , then
The conjecture is correct and proved by AI. Following are AI-generated contents.
Proof
Think of each ball as a vertex. Join two vertices whenever the rules require the corresponding balls to have the same color. Every connected component must be monochromatic, while different components may receive different colors. Thus, is exactly the number of connected components.
It is convenient to regard the labels as the nonzero elements of . The first rule says
The second rule, together with the first, gives an edge between and . If , this follows directly from . If , then
The relation is symmetric: if we can move from to , we can traverse the same edge backward and move from to . Thus we may both subtract and add . Repeating these moves, and applying negation when desired, produces labels congruent to
Equivalently, one could take only nonnegative : because the sequence is periodic modulo , a negative value of can always be replaced by a nonnegative one. The only caveat is that is not an actual label; we handle that case below.
Now let . The subgroup of generated by is precisely the set of multiples of . Therefore, repeated addition of can change a label by any multiple of , and negation can change its residue modulo from to . It follows that two labels and are connected exactly when
There is one small boundary issue: the label is not a ball. This does not split the component consisting of multiples of . In the cycle formed by repeatedly adding , removing leaves a path whose endpoints are and ; the first coloring rule connects those two endpoints. Hence all nonzero multiples of remain in one component.
We are therefore left to count the residue classes modulo after identifying each residue with . They are
If is odd, there are such classes. If is even, there are because both and are fixed by negation. In either case, the total is
Thus
The hidden structure
There are two complementary ways to describe the structure behind the problem. The first is concrete and gives the shortest proof; the second places the same argument in a broader group-theoretic setting.
The cyclic-group interpretation
Regard the labels as elements of the cyclic group . The coloring rules allow the operations
The subgroup generated by consists precisely of the multiples of . Translation by therefore moves within a residue class modulo , while negation identifies the class with . Consequently, the connected components are indexed by
Counting these classes immediately gives . This is the most direct interpretation of why the gcd appears in the answer.
The dihedral-group interpretation
Alternatively, write the two original operations as reflections:
Their composition is the translation
Abstractly, two reflections of this form generate the infinite dihedral group , equivalently the affine Weyl group of type . The orbit of under its action on is
The coloring graph is essentially the Schreier graph of this action: applying either generator draws an edge, so its connected components are exactly the orbits. Although is infinite, this particular action is finite. The translation has order , so the action factors through a finite dihedral group.
Thus the two descriptions say the same thing at different levels. The cyclic-group view computes the orbits directly; the dihedral-group view explains why translation and reflection occur together. The gcd formula is the concrete shadow of this underlying dihedral symmetry.