<s>[INST] How do I find the quotient of the division of $x^{1993}+x^2+1$ by $x^2+x+1$? I have an exercise where I need to find the quotient of the division of polynomial $f=x^{1993}+x^2+1$ by $g=x^2+x+1$. I know to do it the long way but I think there is a trick to do it fast. By the way, I know the remainder is $0$.
 [/INST] Just wrote $$X^{1993}+X^2+1=X^{1993}-X+X^2+X+1=X\left(X^{1992}-1\right)+X^2+X+1.$$
Since $$X^{1992}-1=(X^3-1)(X^{1989}+...+X^3+1)=(X-1)(X^2+X+1)(X^{1989}+...X^3+1),$$
we see that $X^{1993}+X^2+1$ is divisible by $X^2+X+1$.
The  quotient it's $$X(X-1)(X^{1989}+...X^3+1)+1.$$
</s>