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!

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.
