There seems to be an error in the following calculation, I'm not quite sure what it is though. Could someone point it out?

Thanks.

Find the GCD of p(x) = 2x^5 + x^3 + 2^x + 1 and q(x) = x^4 + x^3 + x + 1 in z3[x]

Use the Euclidean algorithm:

2x^5 + x^3 + 2x + 1 = (2x + 1)(x^4 + x^3 + x + 1) + x^2 + 2x

x^4 + x^3 + x + 1 = (x^2 + 2x + 2)(x^2 + 2x) + 1

x^2 + 2x = (1)(x^2 + 2x) + 0

So the answer is 1