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