<s>[INST] 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?
 [/INST] 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}$
</s>