(this number was submitted by @kfunc-vmlinux-utf8nlookup)
A number z is an n-th root of unity if
For example, the solutions to z^3 = 1 are 1, exp(2pi i / 3), and exp(4pi i / 3).
Geometrically, they're equally space around the unit circle on the complex plane, as shown below with the 5th roots of unity:
Some roots of unity are actually roots of unity of a smaller order.
For example, for n = 6, the six roots are
1, exp(2pi i / 6), exp(4pi i / 6), exp(6pi i / 6), exp(8pi i / 6), and exp(10pi i / 6).
exp(2pi i / 6), for example, has order 6: You need to raise it to the sixth power before getting 1. So this is called a primitive sixth root of unity.
However, -1 is also a sixth root of unit because (exp(pi i)^6 = (-1)^6 = 1, but its order is only 2, so it isn't primitive.
The n-th cyclotomic polynomial is written as Φn(x), which is the polynomial whose roots are exactly the primitive n-th roots of unity.
Below is the more formal definition:
For example, Φ1(x) = x - 1 since the only primitive first root of unity is 1.
For n = 2, Φ2(x) = x + 1 because the primitive second root is -1.
For n = 3, the primitive roots are exp(2pi i / 3) and exp(4pi i / 3).
We can simplify. Euler's formula says exp(iθ) = cos(θ) + isin(θ), so for
exp(2pi i / 3), we have θ = 2pi/3. Thus, we get
exp(2pi i / 3) = cos(2pi / 3) + isin(2pi/3) = -1/2 + \sqrt{3}/2 i.
So the corresponding cyclotomic polynomial is:
Φ3(x) = (x - exp(2pi i / 3))(x - exp(4pi i / 3)) = x^2 - x(exp(2pi i / 3) + exp(4pi i / 3)) + exp(2pi i / 3)exp(4pi i / 3).
Now, exp(2pi i /3) + exp(3pi i / 3) = -1 and
exp(2pi i / 3) + exp(4pi i / 3) = e^(2pi i) = 1.
Thus, the cyclotomic polynomial is Φ3(x) = x^2 + x + 1.
Now note something interesting:
x^3 - 1 = (x - 1)(x^2 + x + 1) = Φ1(x)Φ3(x).
In general, every n-th root of unity is primitive for exactly one divisor of n, so we get a fundamental factorization:
Here, the product "d|n" runs over all positive integer divisors d of the natural number n. For example,
So this is a very natural way to build up cyclotomic polynomials.
These polynomials are interesting for a few reasons. One is that they're all integer polynomials. So even though they are a product of a bunch of complex roots, they end up in Z[x].
Even more surprisingly, these polynomials are irreducible over the rationals.
So although its roots are complex numbers involving things like exp(2pi i / n), the polynomial itself has integer coefficients and can't befactored further using rational coefficients.
The degree is also beautifully related to Euler's totient function (counts how many positive integers up to n share no common factors other than 1 with n):
Why? Because there are exactly φ(n) integers 1 ≤ k ≤ n that are relatively prime to n, and the primitive n-th roots are precisely
exp(2pi i k / n) where gcd(k, n) = 1.
So cyclotomic polynomials are essentially the algebraic objects that package together the primitive symmetries of a regular n-gon.
If we look at the first few cyclotomic polynomials, you might notice a pattern:
The coefficients of these polynomials ae all either -1, +1, or 0. In fact, if you looked at the first 100 cyclotomic polynomials, they all have coefficients in the set {-1, +1, 0}.
You might take this as evidence that the coefficients indeed can't be any other integer, and start drawing up a conjecture and proof strategy.
However, eventually there is an exception, namely with the 105th cyclotomic polynomial:
There's a -2 coefficient with the x^41 term. Why is that there? Or rather, why is it there only for the 105th polynomial and none of the others below it?
Well, an interesting fact appears if you factor 105:
It's the smallest number that is the product of three distinct odd primes.
There is a theorem that roughly says that if n has at most two distinct odd prime factors, then every coefficient of Φn(x) is -1, 0, or 1.
So 105 is the first n for which the mathematical conditions permit this phenomenon.
There is, however, an even deeper reason.
There is a useful formula for cyclotomic polynomials called the Möbius function inversion formula:
where μ is the Möbius function, which assigns 1, -1, or 0 to each positive integer n based on its prime factorization.
μ(n) = 1 if n = 1 or n is a square-free integer with an even number of distinct prime factors
μ(n) = -1 if n is a square-free integer with an odd number of distinct prime factors
μ(n) = 0 if n has a squared prime factor (p^2 divides n for some prime p)
For a square-free number with three prime factors,
this becomes a particularly interesting alternating product. For 105,
1, 3, 5, 7, 15, 21, 35, 105
The Möbius function alternates according to the number of prime factors, giving
Φ105(x) = (x^105 - 1)(x^3 - 1)(x^5 - 1)(x^7 - 1) / ((x^35 - 1)(x^21 - 1)(x^15 - 1)(x - 1))
This complicated cancellation is what ultimately creates coefficients larger than 1. For numbers involving only one or two odd primes, there isn't enough combinatorial complexity in these cancellations to product coefficients of 2.
However, with 3 odd primes, it becomes possible.
The 105th cyclotomic polynomial is a nice reminder that numerical patterns can be deceptive. For the first 104 cyclotomic polynomials, every coefficient is 1, 0, or -1, making it tempting to believe that this must always be true. But 105 = 3 * 5 * 7 is the first number with three distinct odd prime factors, and suddenly a coefficient of -2 appears.
What's especially satisfying is that this isn't just a random exception. The behavior of the coefficients is tied to the prime factorization of n, and the Möbius function gives us a way of seeing that structure.
So the strange -2 in Φ105(x) is really just a glimpse of a deeper transition: two odd prime factors are still tame enough to force coefficients to remain in {-1, 0, 1} while 3 allow new behavior.
So 104 examples can give you a very convincing pattern, but sometimes the 105th example is where the mathematics begins.
Thanks again @kfunc-vmlinux-utf8nlookup! This was one of my favorite asks.