\(\displaystyle \bold{(c)}\)
In the last two posts I did not show how I got \(\displaystyle \text{gcd}(a,b) = ax + by\). In this post, I will show in details how to find these two integers \(\displaystyle x\) and \(\displaystyle y\). Since the solution \(\displaystyle \text{gcd}(a,b) = ax + by\) is not unique, there are many integers of \(\displaystyle x\) and \(\displaystyle y\) that satisfy this equation. So I will show in general how to find them. I will also solve the \(\displaystyle \text{gcd}(a,b)\) this time by the \(\displaystyle \textcolor{red}{\text{Euclidean algorithm}}\).
Let us begin the game.
\(\displaystyle 792 = (2)275 + 242\)
\(\displaystyle 275 = (1)242 + 33\)
\(\displaystyle 242 = (7)33 + 11\)
\(\displaystyle 33 = (3)11\)
\(\displaystyle \text{gcd}(792,275) = \textcolor{blue}{11}\)
\(\displaystyle \text{lcm}(792,275) = \frac{792 \times 275}{\text{gcd}(792,275)} = \frac{198000}{11} = \textcolor{blue}{19800}\)
Here is how to find: \(\displaystyle \text{gcd}(792,275) = 792x + 275y\)
Look at the Euclidean algorithm above and try to write it in reverse!
Starting at:
\(\displaystyle 11 = 242 - (7)33\)
\(\displaystyle 11 = 242 - (7)[275 - (1)242]\)
\(\displaystyle 11 = (8)242 - (7)275\)
\(\displaystyle 11 = (8)[792 - (2)275] - (7)275\)
\(\displaystyle 11 = (8)792 - (23)275\)
This gives:
\(\displaystyle \text{gcd}(792,275) = \textcolor{blue}{792(8) - 275(23)}\)
Or in general:
\(\displaystyle x = x_0 + \frac{b}{\text{gcd}(a,b)}t\)
\(\displaystyle y = y_0 - \frac{a}{\text{gcd}(a,b)}t\)
where \(\displaystyle x_0\) and \(\displaystyle y_0\) is one solution you got from the reverse Euclidean algorithm and \(\displaystyle t\) is any integer. In this case, \(\displaystyle x_0 = 8\) and \(\displaystyle y_0 = -23\).
Let us try to find another solution.
\(\displaystyle x = 8 + \frac{275}{11}(1) = 33\)
\(\displaystyle y = -23 - \frac{792}{11}(1) = -95\)
Therefore,
\(\displaystyle \text{gcd}(792,275) = \textcolor{green}{792(33) - 275(95)}\)