0

For example, I have two integer $A=9, B=15$. Here the $\gcd(9,15) = 3$.

If I take two integer $x=2$ and $y=-1$ then $9\cdot2 + 15\cdot(-1)$ will be equal to $3$ which is $\gcd(9,15)$.

So, what will be the general formula to find the value of $x$ and $y$ for any given $A$ and $B$?

vitamin d
  • 5,783

1 Answers1

0

By applying Euclid'Algorithm you can find both the gcd for given $A,B \in \mathbb{Z}$ as well as a pair of $x,y$.

That said, $x,y$ are not unique in this expression.

Indeed, let $$gcd(A,B)=d=xA+yB$$ Then we have: $$d=xA+yB=\\(x-B)A+(y+A)B=\\xA-AB+yB+AB=\\xA+yB$$

So we can create an infinite number of $x^*,y^*$ such that $x^*A+y^*B=d$