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