Proof of polynomial divisibility without using complex numbers? My question is the same as polynomial of degree n and its divisor except I want a solution that does not make use of complex numbers 

Problem: Find all positive integers $n$ such that $x^2+x+1\mid (x+1)^n+x^n+1$

Using wolframalpha, I can see that a number of solutions work, such as $2,4,7$. I tried substituting various values of $x$ in and then working in specific mod cases, but this doesn't really seem to work because it only gives possible values, not 'actual' values. Polynomial long division here is also quite unwieldy...

First I will prove that: $$n \in \{2,4\} \pmod{6}$$ is a necessary condition:
Just substitute x for the value 2 so that the equation results:
$$7 | 3 ^ n + 2 ^ n + 1$$
$$3 ^ n + 2 ^ n + 1 \equiv 0 \pmod{7}$$
whose all solutions are:
$$n \in \{2,4\} \pmod{6}$$
Now I am going to prove that these two conditions are sufficient:
As mentioned above:
$$ P = x^2+x+1 $$
$$(x + 1) ^ 6 \equiv 1 \pmod{P}$$
$$x ^ 6 = 1 \pmod{P}$$
If $n \equiv 2 \pmod {6}$:
$$(x + 1) ^ {6a+2} + x ^ {6a+2} + 1 \pmod{P}$$
$$(x + 1) ^ {6a} (x ^ 2 + 2x + 1) + x ^ {6a} x ^ 2 + 1 \pmod{P}$$
$$(P + x) + x ^ 2 + 1 \pmod{P}$$
$$P + x + x ^ 2 +1 \pmod{P}$$
$$2P \pmod{P}$$
$$ 0 \pmod{P} $$
With which is a sufficient condition.
If $n \equiv 4 \pmod {6}$:
$$(x + 1) ^ {6a+4} + x ^ {6a+4} + 1 \pmod{P}$$
$$(x + 1) ^ {6a} (x ^ 4 + 4x ^ 3 + 6x ^ 2 + 4x + 1) + x ^ {6a} x ^ 4 + 1 \pmod{P}$$
$$(x ^ 4 + 4x ^ 3 + 6x ^ 2 + 4x + 1) + x ^ 4 + 1 \pmod{P}$$
$$2x^4 +4x^3+6x ^ 2 + 4x + 2 \pmod{P}$$
$$2(x^2+x+1)^2 \pmod{P}$$
$$ 0 \pmod{P} $$
With which is a sufficient condition.
It is proved that the condition is necessary and sufficient.
