Using Euclids Extended Algorithm:
Calculate x and y in Bézout's Identity
using (5,187)
For 2 numbers a and b and divisor d:
ax + by = d
a math | a | b math | b | d math | d | k math | k |
---|---|---|---|---|---|---|---|
Set to 1 | 1 | Set to 0 | 0 | 5 | |||
Set to 0 | 0 | Set to 1 | 1 | 187 | Quotient of 5/187 | 0 | |
1 - (0 x 0) | 1 | 0 - (0 x 1) | 0 | Remainder of 5/187 | 5 | Quotient of 187/5 | 37 |
0 - (37 x 1) | -37 | 1 - (37 x 0) | 1 | Remainder of 187/5 | 2 | Quotient of 5/2 | 2 |
1 - (2 x -37) | 75 | 0 - (2 x 1) | -2 | Remainder of 5/2 | 1 | Quotient of 2/1 | 2 |
-37 - (2 x 75) | -187 | 1 - (2 x -2) | 5 | Remainder of 2/1 | 0 | Quotient of 1/0 | 0 |
a = 75 and b = -2
ax + by = gcd(a,b)
5x + 187y = gcd(5