Cyclotomic polynomial

In algebra, a cyclotomic polynomial is a polynomial whose roots are a set of primitive roots of unity. The n-th cyclotomic polynomial, denoted by Φn has integer cofficients.

For a positive integer n, let ζ be a primitive n-th root of unity: then


 * $$\Phi_n(X) = \prod_{(i,n)=1} \left( X - \zeta^i \right) .\,$$

The degree of $$\Phi_n(X)$$ is given by the Euler totient function $$\phi(n)$$.

Since any n-th root of unity is a primitive d-th root of unity for some factor d of n, we have


 * $$X^n - 1 = \prod_{d|n} \Phi_d (X). \,$$

By the Möbius inversion formula we have


 * $$\Phi_n (X) = \prod_{d|n} (X^d-1)^{\mu(n/d)}, \,$$

where μ is the Möbius function.

Examples

 * $$\Phi_1(X) = X-1 ;\,$$
 * $$\Phi_2(X) = X+1 ;\,$$
 * $$\Phi_3(X) = X^2+X+1 ;\,$$
 * $$\Phi_4(X) = X^2+1 ;\,$$
 * $$\Phi_5(X) = X^4+X^3+X^2+X+1 ;\,$$
 * $$\Phi_6(X) = X^2-X+1 ;\,$$
 * $$\Phi_7(X) = X^6+X^5+X^4+X^3+X^2+X+1 ;\,$$
 * $$\Phi_8(X) = X^4+1 ;\,$$
 * $$\Phi_9(X) = X^6+X^3+1 ;\,$$
 * $$\Phi_{10}(X) = X^4-X^3+X^2-X+1. \,$$