Maths & numbers

Nth cyclotomic polynomial calculator

Construct Φₙ(x) with exact integer coefficients and distinguish primitive roots of unity from all nth roots.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

The nth cyclotomic polynomial is the monic polynomial whose roots have multiplicative order exactly n on the complex unit circle. It is not generally xⁿ − 1, because that polynomial also includes roots of smaller orders dividing n. The calculator constructs the desired factor by exact division, recursively removing the factors for proper divisors. Coefficients are kept as integers throughout and are displayed by descending power.

THE FORMULAxⁿ − 1 = ∏(d divides n) Φ_d(x); Φ_n contains exactly the primitive nth roots of unity.

A worked example

For n = 6, x⁶ − 1 = (x − 1)(x + 1)(x² + x + 1)(x² − x + 1). The first three factors correspond to orders 1, 2 and 3. The remaining factor is Φ₆(x) = x² − x + 1, whose two roots lie at angles +60° and −60° and have exact order six.

Good to know

The input order is an integer from one through 200. This page constructs exact coefficients; it does not approximate every complex root or factor an arbitrary user polynomial. Long expressions retain all coefficients, including zeros in the table. It does not assume coefficients are always −1, 0 or 1.

Only roots of exact order n belong in Φₙ

The six roots of x⁶ = 1 occur at angles 0°, 60°, 120°, 180°, 240° and 300°. Only the roots at 60° and 300° require six powers to return to one. The root at 180° has order two, those at 120° and 240° have order three, and the root at 0° has order one. Removing those smaller-order groups leaves the degree-two polynomial in the default result.

The degree of Φ_n is Euler’s totient φ(n), the number of residue exponents between one and n that are coprime to n. For six, only exponents one and five qualify, so the degree is two. This gives a useful independent size check against the coefficient output. The existing totient calculator can verify that degree without constructing the polynomial.

The primitive sixth roots are the two unit-circle points at plus and minus sixty degreesPrimitive: ±60°Φ₆ = x² − x + 1
The roots of Φ₆(x) = x² − x + 1 have exact order six. The other sixth roots belong to the factors Φ₁, Φ₂ and Φ₃.

The Euler totient calculator independently checks the degree of the nth cyclotomic polynomial.

Build the factor using exact polynomial divisions

For each proper divisor d of n, the calculator first constructs Φ_d and removes that factor from xⁿ − 1. Every division is exact in the integer polynomial ring. The remaining monic factor is Φ_n. The step summary lists the divisors used, and the coefficient table retains zero terms even when the compact expression omits them. Thus a missing x term is distinguishable from a missing coefficient.

When n is prime, the answer simplifies to 1 + x + … + x^(n−1). For composite orders there is no universal geometric-sum shortcut. Order one is also important: Φ₁(x) = x − 1. Although many small examples have coefficients only in −1, 0 and 1, this is not a general theorem; order 105 already has coefficients with magnitude two. Generic polynomial arithmetic can manipulate a supplied expression, but this page constructs a mathematically specified polynomial from its order.

A few questions, answered

Does Φₙ contain every nth root of unity?

Only when every nth root has exact order n, which is not the general case. The full set belongs to xⁿ − 1 and splits among cyclotomic factors indexed by divisors of n.

Why is the leading coefficient always one?

Cyclotomic polynomials are defined as monic products of x minus each primitive root. The construction preserves that normalization.

Find your calculator

Start typing to explore the library.