Use the Euclidean Algorithm to find the values of integer $x$ and $y$ satisfying $gcd(24,138) = 24 \cdot x + 138 \cdot y$.
Example: Use the Euclidean Algorithm to find the values of integer $x$ and $y$ satisfying $gcd(24,138) = 24 \cdot x + 138 \cdot y$.
Solution: Firstly, we find $gcd(24,138)$ using Euclidean Algorithm. We apply Division Algorithm to integers $24$ and $138$. Firstly, we divide $138$ by $24$. When we divide $138$ by $24$, we get $q = 5$ (i.e. $5$ is a quotient) and $r = 18$ (i.e. $18$ is a remainder). So we get following system of equations in Euclidean Algorithm.
$138 = 24~ \cdot ~5 + 18$
$24 = 18 ~\cdot~ 1 + 6$
$18 = 6 ~\cdot ~3 + 0$
$6$ is the last nonzero remainder obtained in this Algorithm, \linebreak so $gcd(24, 138) = 6$.
From the above equations, $gcd(24,138) = 6$ can be written as follows
$6 = 24 ~-~ 18 ~\cdot~ 1$
we put $18 = 138 ~-~ 24 ~\cdot~ 5$ in above equation, so we get
$6 = 24 ~-~ (138 - 24 ~\cdot~ 5) ~\cdot~ 1$
$6 = 24 ~-~ 138 ~\cdot~ 1 + 24 ~\cdot~ 5 $
$6 = 24 ~\cdot~ 6 ~-~ 138 ~\cdot~ 1 $
$6 = 24 ~\cdot~ 6 + 138 ~\cdot~ (-1) $
comparing with $gcd(24,138) = 6 = 24 \cdot x + 138 \cdot y$, we get $x = 6$ and $y = -1 $.