# Finding the $18$th cyclotomic polynomial $\phi_{18}(X))$.

I know that for an $n$th cyclotomic polynomial $\phi_n(X)$ the following equations hold:

$x^n-1=\prod_{n_1|n} \phi_{n_1}(X)$

For $n=p$ prime, $\phi_p(X)=X^{p-1}+...+X+1$

So I used the following method to calculate $\phi_{18}(X)$:

$X^{18}-1=\phi_{1}(X)\phi_{2}(X)\phi_{3}(X)\phi_{18}(X)$

$\phi_{1}(X)=X-1$

Since $2$ and $3$ are prime, using above formula: $\phi_{2}(X)=X+1$ and $\phi_{3}(X)=X^2+X+1$

$\phi_{18}(X)=\frac{X^{18}-1}{(X-1)(X+1)(X^2+X+1)}$

But I have checked the real answer and plugged in values of $X$ that give different answers. So I think my version in wrong. Where have I gone wrong?

Many thanks

• What about $\phi_6(X)$ and $\phi_9(X)$? $6$ and $9$ divide $18$. Apr 3, 2016 at 16:18
• Ah yes.. of course. I will try that now. I think I just realised that $18=2 \times 3^{2}$, so I only considered $2$, $3$, $1$ and $18$ Apr 3, 2016 at 16:21
• If $n$ is odd, then $\Phi_{2n}(X)=\Phi_n(-X)$. Apr 3, 2016 at 16:55

You need to consider all divisors of $18$. You left out $6$ and $9$.