đặt m=3k+r,n=3s+t(r,s,<3)
$\begin{array}{l}
{x^m} + {x^n} + 1 = {x^{3k + r}} + {x^{3s + t}} + 1 = {x^{3k}}.{x^r} - {x^r} + {x^{3s}}.{x^t} - {x^t} + {x^r} + {x^t} + 1\\
= {x^r}\left( {{x^{3k}} - 1} \right) + {x^t}\left( {{x^{3s}} - 1} \right) + {x^r} + {x^t} + 1\\
\left( {{x^{3k}} - 1} \right) \vdots \left( {{x^3} - 1} \right) \vdots {x^2} + x + 1va\left( {{x^{3s}} - 1} \right) \vdots \left( {{x^3} - 1} \right) \vdots {x^2} + x + 1\\
{x^m} + {x^n} + 1 \vdots {x^2} + x + 1khi{x^r} + {x^t} + 1 \vdots {x^2} + x + 1\\
\Leftrightarrow r = 2;t = 1 \Rightarrow m = 3k + 2;n = 3s + 1\\
\Leftrightarrow r = 1;t = 2 \Rightarrow m = 3k + 1;n = 3s + 2\\
\Leftrightarrow mn - 2 = (3k + 2)(3s + 1) - 2 = 3(3ks + k + 2s)\\
mn - 2 = (3k + 1)(3s + 2) - 2 = 3(3ks + s + 2k)\\
\Rightarrow mn - 2 \vdots 3
\end{array}$
vậy x^m+x^n+1 chia hết x^2+x+1 khi va chỉ khi mn-2 chia hết cho 3