bezout — equação de Bezout para polinômios ou inteiros
[thegcd,U]=bezout(p1,p2)
[thegcd,U]=bezout(p1,p2) computa o MDC
thegcd de p1 e p2
e também uma matriz (2x2) unimodular U tal quet:
[p1,p2]*U = [thegcd,0]
O MMC de p1 e p2 é dado
por:
p1*U(1,2) (or
-p2*U(2,2))
// caso polinomial x=poly(0,'x'); p1=(x+1)*(x-3)^5;p2=(x-2)*(x-3)^3; [thegcd,U]=bezout(p1,p2) det(U) clean([p1,p2]*U) thelcm=p1*U(1,2) lcm([p1,p2]) // caso inteiro i1=int32(2*3^5); i2=int32(2^3*3^2); [thegcd,U]=bezout(i1,i2) V=int32([2^2*3^5, 2^3*3^2,2^2*3^4*5]); [thegcd,U]=gcd(V) V*U lcm(V)