I need to calculate the GCD of $$x^4+3x^3+2x^2+x+4 \ \text{and } x^3+3x+3 \ \text{in} \ \mathbb{Z}_5$$ Using Euclid algorithm: $$x^4+3x^3+2x^2+x+4 = (x^3+3x+3)(x+3)-3x\\ x^3+3x+3 = (-3x)(\frac{1}{3}x^2 - \frac{2}{3})+3 \\-3x = (3)(-x)+0 $$ Now I should consider the last not-null remainder (so 3) that (I think) it should be the GCD, actually it seems that the GCD is 1 according to wolfram
So my question is: what result should I consider as GCD when GCD is calculated with polynomials?