How do I solve 648x+353y=1648x+353y=1 for xx and yy working backwards from Euclid's algorithm for gcd(648,353)gcd(648,353)?

1 Answer
Dec 5, 2017

x=-140x=140 and y=257y=257

Explanation:

To find xx and yy, we must first find gcd(648,353)gcd(648,353) using Euclid's algorithm.

648=353+395648=353+395 so gcd(648,353)=gcd(353,295)gcd(648,353)=gcd(353,295)

353=295+58353=295+58 so gcd(353,295)=gcd(295,58)gcd(353,295)=gcd(295,58)

295=5*58+5295=558+5 so gcd(295,58)=gcd(58,5)gcd(295,58)=gcd(58,5)

58=11*5+358=115+3 so gcd(58,5)=gcd(5,3)gcd(58,5)=gcd(5,3)

5=3+25=3+2 so gcd(5,3)=gcd(3,2)gcd(5,3)=gcd(3,2)

3=2+13=2+1 so gcd(3,2)=gcd(2,1)gcd(3,2)=gcd(2,1)

2=1*2+02=12+0 so gcd(2,1)=gcd(1,0)=gcd(648,353)=1gcd(2,1)=gcd(1,0)=gcd(648,353)=1

Now we have 648x+353y=1648x+353y=1. But using the steps above, we can substitute in values until we get the equation in terms of multiples of 648648 and 353353.

648x+353y=1648x+353y=1

=3-2=32

=58-11*5-(5-3)=58115(53)

=58-12*5+(58-11*5)=58125+(58115)

=2*58-23*5=258235

=2(353-295)-23(295-5*58)=2(353295)23(295558)

=2*353-25*295+115*58=235325295+11558

=2*353-25(648-353)+115(353-295)=235325(648353)+115(353295)

=142*353-25*648-115*295=14235325648115295

=2*353-25(648-353)+115(353-295)=235325(648353)+115(353295)

=142*353-25*648-115*(648-353)=14235325648115(648353)

=-140(648)+257(353)=140(648)+257(353)

so x=-140x=140 and y=257y=257