Greatest common divisor using euclidean(alternate answers)

123 Views Asked by At

$\gcd(1022,400)=a\times1022 + b\times400$ and I found the $\gcd=2$. And $a=-9$ and $b=23$ through euclidean. But then the answer says $(a,b)$ can also be $(-9+400,23-1022)$, $(791,-2021)$ and so on.

I'm not really seeing the pattern here can someone help explain?

1

There are 1 best solutions below

0
On BEST ANSWER

Suppose you have some $a$ and $b$ for which $a\times 1022 + b\times 400=2$, then you can obtain other solutions by adding $400$ to $a$ and subtracting $1022$ from $b$, because by doing this, you add $400\times 1022$ to your expression, and at the same time, you subtract $1022\times 400$. You can do this as many times as you want, so you get infinitely many solutions:

$a=-9, b=23$

$a=-9+400, b=23-1022$

$a=-9+2(400), b=23-2(1022)$

$\vdots$

$a=-9+k(400), b=23-k(1022)$, for any $k\in\mathbb{Z}$.