How to see that $\text{gcd}(a,b) = \text{gcd}(a-b,b)$?

173 Views Asked by At

I'm trying to understand why $\text{gcd}(a,b) = \text{gcd}(a-b,b)$. What is clear to me is that the $\text{gcd}$ divides $a,b$ and also $a-b$ (let's assume $a\ge b$).

But then it seems to me we should also have $\text{gcd}(a,b) = \text{gcd}(a-b,a)$. But that's not mentioned on Wikipedia so it might not true.

Trying some examples (look at for example $a=7$ and $b=2$) I can't find an example for which $\text{gcd}(a,b) \neq \text{gcd}(a-b,a)$.

If I understood why $\text{gcd}(a,b) = \text{gcd}(a-b,b)$ then I could figure out whether $\text{gcd}(a,b) = \text{gcd}(a-b,a)$ or not.

So my question is:

Please could someone explain to me why $\text{gcd}(a,b) = \text{gcd}(a-b,b)$?

3

There are 3 best solutions below

1
On BEST ANSWER

$\rightarrow:$ Suppose $x|a, x|b$ then $x| a-b$

$\leftarrow:$ Suppose $x|b, x|a-b$ then $x|b+(a-b)=a$

Hence the pair $(a,b)$ and $(a-b,b)$ share the same set of common divisors.

0
On

(0) Anything that divides the members of $\{a,b\}$ will divide the members of $\{a-b,b\} $, and vice-versa, so they have the same $\gcd.$ To put this in detail : (1). Suppose $x$ and $y$ are not both $0 $, so that $\gcd (x,y)$ exists. $$\text {Then }\quad n|x\land n|y \implies n\leq \gcd (x,y).$$(2). If $a,\;b$ are not both $0$ then $(a-b),\;b$ are also not both $0.$$$\text { Consider the case } x=a-b,\; y=b,\; n=\gcd (a,b).$$ Now $a/n$ and $b/n$ are integers, so we see that $(a-b)/n=a/n-b/n$ is an integer. $$\text {Since } n|(a-b)=x\land n|b=y, \text { we have}$$ $$(3)\quad \gcd (a,b)=n\leq \gcd (x,y)=\gcd (a-b,b).$$ $$\text { Consider the case } x'=a,\;y'=b,\; n'=\gcd (a-b,b).$$Now $(a-b)/n'$ and $b/n'$ are integers, so we see that $a/n=(a-b)n+b/n $ is an integer.$$\text {Since } n'|a=x' \land n'|b,\text { we have }$$ $$(4)\quad \gcd (a-b,b)=n'\leq \gcd (x',y')=\gcd (a,b).$$ From (3) and (4) we have $$(5)\quad \gcd (a,b)=\gcd (a-b,b).$$ Observe that we can interchange the letters $a$ and $b$ throughout, so from (5) we have $$(6)\quad \gcd (a,b)=\gcd (b,a)=\gcd (b-a,a)=\gcd (a-b,a).$$ Note that the signs of $a,b,(a-b)$ don't matter because $\gcd (x,y)=\gcd (|x|,|y|)$.

0
On

$$(a-b)+b=a\implies \gcd(a-b,b)\mid a\implies \gcd(a-b,b)\le \gcd(a,b)\tag{1}$$$$a-b=(a-b)\implies \gcd(a,b)\mid (a-b)\implies \gcd(a,b)\le \gcd(a-b,b)\tag{2}$$Combining $(1)$ and $(2)$ we get $\gcd(a,b)=\gcd(a-b,b)$.