airdrowned

5 Reputation

2 Badges

10 years, 281 days

MaplePrimes Activity


These are replies submitted by airdrowned

@Carl Love Sorry for whatever reason it won't let me upload the worksheet. Here is the code:

ExtEuclidean:= proc(f,g) local p, r, s, t, i, q, l;
p[0]:=lcoeff(f);
p[0]:=lcoeff(f);
r[0] := f/p[0];
r[1] := f/p[0];
s[0]:=1;
s[1]:=0;
t[0]:=0;
t[1]:=1;
i:=1;
while r[i] != 0 do
l:= i;
q[i]:= quo(r[i-1],r[i],x);
p[i+1]:=lcoeff(r[i-1]-q[i]*r[i]);
r[i+1]:= (r[i-1]-q[i]*r[i])/p[i+1];
s[i+1]:= (s[i-1]-q[i]*s[i])/p[i+1];
t[i+1]:= (t[i-1]-q[i]*t[i])/p[i+1];
i:= i+1;
normal(r[i]);
od;
return(l, p[i],r[i],s[i],t[i],q[i]);
end proc;

@Carl Love I Called it with ExtEuclidean(3*x^9, 2*x^2+x^3);
But the input can be any two polynomials.

Page 1 of 1