By the way, it's easy to find the Zn roots of the polynomial: modulus:197$ for i:0 thru 197 do if ratsubst(i,x,x^51+x^22+1)=0 then print (i); => 177 rat(177) => -20 divide(x^51+x^22+1,x-177) => [yyy,0] Trying to factor yyy gets you back to the original bug, unsurprisingly.... -s