<s>[INST] Divisibility of a polynomial by another polynomial I have this question: 
Find all numbers $n\geq 1$ for which the polynomial $x^{n+1}+x^n+1$ is divisible by $x^2-x+1$. How do I even begin?
So far I have that  $x^{n+1}+x^n+1 = x^{n-1}(x^2-x+1)+2x^n-x^{n-1}+1,$ and so the problem is equivalent to finding $n$ such that  $2x^n-x^{n-1}+1$ is divisible by $x^2-x+1.$
A solution that I found goes as follows (but I don't understand it!):
Assume that $x^n+1=(x^m-x+1)Q(x).$ The polynomial $x^m-x+1$ has a real root in the interval $(0,1)$ but $x^n+1$ has no positive real roots. So, no such pairs $m,n$ exist.
Any help?
 [/INST] Hint: The roots of $x^2-x+1=0$ are $e^{i\pi/3}$ and $e^{-i\pi/3}$. If we show that one (and therefore the other) cannot be a root of $x^{n+1}+x^n+1$, then we will know that $x^2-x+1$ cannot divide $x^{n+1}+x^n+1$. 
There are $3$ cases to examine: (i) $n$ is of the form $3k+2$; (ii) $n$ is of the form $3k+1$; and (iii) $n$ is of the form $3k$.
</s>