# Find the remainder of the division

Find the remainder when $f(x)=x^{2017}-1$ is divided by $(x^2+1)(x^2+x+1)$

I have expanded the function and factorized it. The remainder I had found was $-x^3-2x^2-3$ I am not sure if I was right ! So can anyone tell me the other way to solve it ..?

$$x^{2017}-1=x((x^3)^{672}-1)+x-1\equiv x-1\pmod{x^3-1}\equiv x-1\pmod{x^2+x+1}$$

and $$x^{2017}-1=x((x^4)^{504}-1)+x-1\equiv x-1\pmod{x^4-1}\equiv x-1\pmod{x^2+1}$$

Luckily both remainders are same and $$(x^2+x+1,x^2+1)=1$$

• I finally found my mistake! Thank you so much.! – November ft Blue Oct 30 '17 at 9:23

The hint: $$f(x)=x^{2017}-x+x-1$$ and $$x^{2016}-1=(x^4)^{504}-1$$ is divisible by $x^4-1=(x^2-1)(x^2+1).$

Also, $$x^{2016}-1=(x^3)^{672}-1$$ is divisible by $x^3-1=(x-1)(x^2+x+1),$ which gives that there is polynomial $g$ for which $$f(x)=(x^2+1)(x^2+x+1)g(x)+x-1.$$

• Thank you ! I finally found my mistake:) ! – November ft Blue Oct 30 '17 at 9:24
• @November ft Blue You are welcome! – Michael Rozenberg Oct 30 '17 at 9:25