For which $n \in \mathbb{N}$ it is true that $x^2+x+1 | (x+1)^n-x^n-1$ I have to find such $n \in \mathbb{N}$ for which $x^2+x+1 | (x+1)^n-x^n-1$.
$x^2+x+1$ has 2 complex roots: $x_1=-((-1)^{(1/3)})$, $x_2=(-1)^{(2/3)}$ so I tried to divide $(x+1)^n-x^n-1$ by $(x-x_1)$ and then $(x-x_2)$ but it was too difficult. Any other hints?
 A: As $(x-1)(x^2+x+1)=x^3-1,$ the roots of $x^2+x+1=0$ are complex cube roots$(w,w^2)$ of unity
So, $w^2+w+1=0$
Let $w=e^{2\pi i/3}\implies w^2=e^{-2\pi i/3},-w^2=e^{\pi i(1-2/3)}$
Now using About Euler's formula $e^{ix}=\cos x+i\sin x$,
$$f(w)=(w+1)^n-w^n-1=(-w^2)^n-w^n-1=(e^{\pi i/3})^n-(e^{2\pi i/3})^n-1$$
$$=\cos\dfrac{n\pi}3+i\sin\dfrac{n\pi}3-1-\cos\dfrac{2n\pi}3-i\sin\dfrac{2n\pi}3$$
We need $f(w)=0$
Equate the imaginary & the real parts -
$$\sin\dfrac{2n\pi}3=\sin\dfrac{n\pi}3$$
$\implies$ either $(i)\dfrac{2n\pi}3\equiv\dfrac{n\pi}3\pmod{2\pi}$
or $n\equiv0\pmod6$
But then $\cos\dfrac{n\pi}3-1-\cos\dfrac{2n\pi}3\ne0$
or $(ii)\dfrac{2n\pi}3\equiv\pi-\dfrac{n\pi}3\pmod{2\pi}$
$\implies n\equiv1\pmod2$
Again, $\cos\dfrac{n\pi}3-1-\cos\dfrac{2n\pi}3=\cos\dfrac{n\pi}3-2\cos^2\dfrac{n\pi}3=-\cos\dfrac{n\pi}3\left(2\cos\dfrac{n\pi}3-1\right)$
I hope yo can take it from here!
A: Let roots of $x^2+x+1$ be $w,w^2$. Thus for this polynomial to divide $P(x)= (x+1)^n-x^n-1$, $w,w^2$ must be roots of $P(x)$.
We must have $(w+1)^n - w^n -1 = 0$ and $(w^2+1)^n-w^{2n}-1 = 0$.
Thus we have $(-1)^nw^{2n}-w^n-1 = 0$ and $(-1)^nw^n-w^{2n}-1=0$


*

*Case $n$ is even: Then we have $w^{2n}-w^n-1=0$ and $w^n-w^{2n}-1 = 0$


*

*$n$ is multiple of $3$: These give $-1 = 0$, so no solutions in this case.

*$n$ not multiple of $3$: These give $w^n = -w^n$. So no solutions.


*Case $n$ is odd: We have $-w^{2n}-w^n - 1 = 0$ and $-w^n-w^{2n}-1 = 0$.


*

*$n$ is multiple of $3$: From second equation we have $-3 = 0$. So no solutions.

*$n$ not multiple of $3$: Now both the equations are satisfied. Hence this is the only solution.
So we have that $n$ is not a multiple of $2$ or $3$. Hence we can say $n = \boxed {6k\pm 1}$
