281,442 views
14 votes
14 votes
Use the extended euclidean algorithm to express gcd(252, 356) as a linear combination of 252 and 356.

User Gromer
by
2.8k points

1 Answer

11 votes
11 votes

The Euclidean algorithm gives us

356 = (1 • 252) + 104

252 = (2 • 104) + 44

104 = (2 • 44) + 16

44 = (2 • 16) + 12

16 = (1 • 12) + 4

12 = (3 • 4) + 0

which means gcd(252, 356) = 4. Now we work backwards:

4 = 16 - 12

4 = 16 - (44 - (2 • 16)) = (3 • 16) - 44

4 = 3 • (104 - (2 • 44)) - 44 = (3 • 104) - (7 • 44)

4 = (3 • 104) - (7 • (252 - (2 • 104))) = (17 • 104) - (7 • 252)

4 = (17 • (356 - 252)) - (7 • 252) = (17 • 356) - (24 • 252)

User Neuront
by
3.2k points