Find all pairs of positive integers $(m, n)$ for which $X^m + X + 1$ divides $X^n + 1$ and pairs $(m,n)$ for which $X^m +X −1$ divides $X^n +1$? 
The special case I can think of is when $n=3$, and $m=2$ for the first part. But I don't know if other cases exist. Any help would be appreciated. Thanks!
 A: Let $r$ be a root of $X^m+X+1.$ The roots of $X^n+1$ lie on the unit circle, so $r$ does as well. Since $\Im(r+r^m) = \Im(-1) = 0$ and $r^m, r$ lie on the unit circle, $r, r^m$ are conjugates, so $r = r^{-m} \Rightarrow r^{m+1} = 1.$ But we also have $r^{m+1} = -r^2 - r,$ so $r^2+r+1 = 0 \Rightarrow r = w, w^2$ where $w \ne 1$ is a $3$rd root of unity. By differentiation, we see $X^m+X+1$ has no double roots, hence at most $2$ roots, which means $m \le 2.$ Furthermore, $w$ is a root iff $\overline{w} = w^2$ is a root, so $m=2.$ But $w^n + 1 \in \{2, w+1, w^2+1\},$ none of which are zero, so no value of $m$ works.
The 2nd problem is similar. We get $r^{m+1} = 1 \Rightarrow 1 = r-r^2 \Rightarrow r^2-r+1 = 0 \Rightarrow r=w, w^5$ where $w$ is a primitive $6$th root of unity. By differentiation, there are no double roots, so $m \le 2.$ Again, $w$ is a root iff $\overline{w} = w^5$ is a root, so $m=2.$ But then $w^2 + w - 1 = w^2 - w + 1 = 0 \Rightarrow w^2=0,$ contradiction, so there are no solutions again.
A: If $P(X) = X^m+X+1$ divides $X^n+1$, any root $r$ of $X^m+X+1$ is a root of unity.  Thus $r$ is a primitive $k$'th root of unity for some $k$, and $P(X)$ is divisible by the
$k$'th cyclotomic polynomial $C_k(X)$.  In particular, since $1/r$ is also a primitive
$k$'th root of unity whenever $r$ is, $X^m+X^{m+1}+1 = X^m P(1/X)$ is also divisible by
$C_k(x)$, and so are $Q(X) = P(X) - X^m P(1/X) = X - X^{m-1}$ and $P(X) +X Q(X) =  X^2 + X + 1 = C_3(X)$.  Now neither of the roots of $C_3(X)$ have a power that is $-1$, so the first case is impossible.
A: I get that
there are no solutions
for $x^m+x+1$.
The roots of
$x^n+1$ are
$e^{(2k+1) \pi i/n}$
for $k = 0$ to $n-1$,
so
all the roots have magnitude $1$.
If $m = 1$ then
$x = -\frac12$
so
$\dfrac{(-1)^n}{2^n}+1 = 0$
which can't be.
If $m = 2$
the roots of
$x^2+x+1$
are
$x_{1, 2}
=\dfrac{-1\pm\sqrt{-3}}{2}
=e^{\pm 2\pi i/3}
$.
Then
$x_1^n
=e^{2\pi n i/3}
=-1
=e^{(2k+1)\pi i}
$
for some $k$
so
$2n/3 =2k+1
$
so
$2n = 6k+3
$
and this can't be since
the left side is even
and the right side is odd.
The same thing holds for
$x_2
=e^{-2\pi i/3}
$.
Therefore
there are no solutions for
$m = 2$.
If $m > 2$ then
for $m$ values of
$0 \le k \le n-1$,
$\begin{array}\\
0
&= x^m+x+1\\
&=e^{(2k+1)m \pi i/n}+e^{(2k+1) \pi i/n}+1\\
&=\cos((2k+1)m\pi/n)+i\sin((2k+1)m\pi/m)
+\cos((2k+1)\pi/n)+i\sin((2k+1)\pi/m)
+1\\
&=\cos((2k+1)m\pi/n)+\cos((2k+1)\pi/n)+1
+i(\sin((2k+1)m\pi/m)+\sin((2k+1)\pi/m))\\
&=\cos((2k+1)m\pi/n)+\cos((2k+1)\pi/n)+1\\
&=\cos(mr)+\cos(r)+1
\qquad\text{where }r = (2k+1)\pi/n\\
\text{and}\\
0
&=\sin((2k+1)m\pi/n)+\sin((2k+1)\pi/n)\\
&=\sin(mr)+\sin(r)\\
\end{array}
$
Therefore
$\sin(mr)
=-\sin(r)
$
so
$\sin^2(mr)
=\sin^2(r)
$
$\cos^2(mr)
=\cos^2(r)
$.
If
$\cos(mr)
=\cos(r)
$
then
$0
=\cos(mr)+\cos(r)+1
=2\cos(r)+1
$
so,
since
$0 < r < 2\pi$,
$r 
= 2\pi/3,
= -2\pi/3
$.
If $r = 2\pi/3$,
$2/3
=(2k+1)/n
$
so
$2n
=3(2k+1)
=3k+3
$
but this can not be since
the left side is even
and the right side is odd.
Similarly,
If $r = -2\pi/3$,
then
$-2/3
=(2k+1)/n
$
so
$-2n
=3(2k+1)
=3k+3
$
but this also can not be since
the left side is even
and the right side is odd.
Therefore there
are no solutions.
