Using Euclids Extended Algorithm:
Calculate x and y in Bézout's Identity
using (2,17)
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 | 2 | |||
Set to 0 | 0 | Set to 1 | 1 | 17 | Quotient of 2/17 | 0 | |
1 - (0 x 0) | 1 | 0 - (0 x 1) | 0 | Remainder of 2/17 | 2 | Quotient of 17/2 | 8 |
0 - (8 x 1) | -8 | 1 - (8 x 0) | 1 | Remainder of 17/2 | 1 | Quotient of 2/1 | 2 |
1 - (2 x -8) | 17 | 0 - (2 x 1) | -2 | Remainder of 2/1 | 0 | Quotient of 1/0 | 0 |
a = -8 and b = 1
ax + by = gcd(a,b)
2x + 17y = gcd(2