Solution (source code)

= Solution

The <cyclotomic polynomial> is
$$
\Phi_n(X)=\prod_{\substack{1\leq a\leq n\\(a,n)=1}}
(X-\zeta_n^a),
$$
where $\zeta_n$ is primitive. Partitioning all $n$th roots by exact order gives the <cyclotomic factorization>
$$
X^n-1=\prod_{d\mid n}\Phi_d(X).
$$
Induct on $n$. The quotient of the monic integer polynomial $X^n-1$ by the product of the already constructed monic $\Phi_d$, $d<n$, lies in $\mathbb Q[X]$ and is monic. <Gauss lemma> then shows that this quotient $\Phi_n$ lies in $\mathbb Z[X]$.

If the prime $p$ does not divide $n$, then over $\mathbb F_p$,
$$
\gcd(X^n-1,nX^{n-1})=1.
$$
\b[Thus $X^n-1$ has no repeated root. Every factor, including the reduction of $\Phi_n$, is square-free, proving the <Separability of a cyclotomic polynomial modulo p>.]