How many positive integers n are there such that $3\le n\le 100$ and $x^{2^n}+x+1$ is divisible by $x^2+x+1$?
Any hints are appreciated.
How many positive integers n are there such that $3\le n\le 100$ and $x^{2^n}+x+1$ is divisible by $x^2+x+1$?
Any hints are appreciated.
Hint
For $x^2+x+1$ to divide $x^{2^n}+x+1$, all the roots of $x^2+x+1$ should be roots of the other polynomial as well.
Observe that $\omega=\frac{-1+i\sqrt{3}}{2}$ and $\omega^2$ are roots of $x^2+x+1$. Thus $\omega^3=1$ and $1+\omega+\omega^2=0$. Use these to determine when will $$\omega^{2^n}+\omega+1=0.$$ This condition can be restated as $$\omega^{2^n-2}=1.$$ This means $$3 \mid 2^n-2 \implies 2^n \equiv 2 \pmod{3}.$$
Hint:
The roots of $x^2+x+1$ are the non-real roots of unity, $j$ and $j^2$. So we must have $j^{2^n}=j^2$, which means $$2^n\equiv 2\mod 3\iff(-1)^n\equiv -1\mod 3.$$ Can you conclude?
I can divide the two polynomial, using the specific division algorithm. I start with $x^{2^n}+0\cdot x^{2^{n-1}}+0\cdot x^{2^{n-2}}+\cdots+x+1$ and divide it by $x^2+x+1$.
At the first iteration, I obtain, as partial quotient $Q_1(x)=x^{2(2^{n-1}-1)}$ and, as partial rest, $R_1(x)=-x^{2^n-1}-x^{2^n-2}+\cdots+x+1$.
At the second $Q_2(x)=x^{2(2^{n-1}-1)}-x^{2^n-3}$ and $R_2(x)=x^{2^n-3}+\cdots+x+1$.
At the third: $Q_3(x)=x^{2(2^{n-1}-1)}-x^{2^n-3}+x^{2^n-5}$ and $R_3(x)=x^{2^n-4}+\cdots-x^{2^n-5}+x+1$. And so on...
If $R(x)=0$ (I can't divide $x$ by $x^2$), after $m$ iterations, $R_m(x)$ has to be equal to $-x-1+x+1=0$. This occours only if $n=2,5,8$ (as shown in the iterations): in general when $n=2+3k$ with $k\in N$. The number of such $n$ is, in conclusion: $\left \lfloor \frac{100-2}{3} \right \rfloor=32$.
By here $\ x^{2}\!+\!x\!+\!1\mid x^A\! +\! x^B\! +\! x^C\, $ iff $ \ \{A,B,C\}\equiv \{2,1,0\}\pmod{\!3}$
Hence: $\ \ x^{2}\!+\!x\!+\!1\mid x^{\large 2^n}\! + x +\! 1\ $ iff $ \ 2^n \equiv 2\pmod{\!3}$