Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Project: Math 201
Views: 185
def gcdEA(a,b): """ This function returns the Greatest Common Divisor of a and b. """ x=abs(a) y=abs(b) while (y>0): r = mod(x,y) x = y y = r print (x,y) return x
gcd62-b379-dae82402d7c4
gcdEA(5800,89)
(89, 15) (15, 14) (14, 1) (1, 0) 1
x=242908624 y=101 gcdEA(x,y)
(101, 89) (89, 12) (12, 5) (5, 2) (2, 1) (1, 0) 1
gcd(22*52,7) gcdEA(22*52,7)
1 (7, 3) (3, 1) (1, 0) 1
xgcd(512,251)
(1, -25, 51)
512*-25+251*51
1