0

I want to prove: $$\gcd(x,y)=\gcd(x,x+y)$$

I thought of using Euclid's algorithm, where $p=q*d+r$
My proof:

$\gcd(x,x+y)$ is equivalent to $$ (1) x+y=x*1+y $$

The next step in the algorithm is: $$x=d*y+r$$

And then $\gcd(x,y)$ is equivalent to:

$$ (2) x=d*y+r $$

Since step $2$ of (1) is the same as (2), won't they both result in the same gcd? Thus proving that $$\gcd(x,y)=\gcd(x,x+y)$$

TShiong
  • 1,257
  • The easiest way to prove this is to assume that $\gcd(x,y)>\gcd(x,x+y)$, then use "$r | x$ and $r | y $ $\implies r | (x+y)$" to derive a contradiction. – Jamie Alizadeh Jan 14 '23 at 21:01

1 Answers1

1

Yes, that's a very nice idea. I just wouldn't say that $\gcd(x,x+y)$ is equivalent to $x+y=1\cdot x+y$. Instead, I would say that in order to obrtain $\gcd(x,x+y)$ we start the Euclid's algorithm by considering $x+y=1\cdot x+y$. In the second step of the algorithm we consider $x=dy+r$, which is equal to the first step of Euclid's algorithm for $\gcd(x,y)$, thus both algorithms yield the same result $\gcd(x,y)=\gcd(x+y,y)$.

Alternatively, you can observe that any number that divides $x$ and $y$ also divides $x+y$, in particular $\gcd(x,y)$ divides $x+y$. Any integer $n$ greater than $\gcd(x,y)$ that divides $y$ cannot divide $x+y$ because $y/n$ is an integer, and thereby $(x+y)/n=x/n+y/n$ is not, since $n$ does not divide $x$ (otherwise we would have $n\le\gcd(x,y)$ because $n$ divides both $x,y$).

Matija
  • 3,526
  • Please strive not to post more (dupe) answers to dupes of FAQs, cf. recent site policy announcement here. – Bill Dubuque Jan 14 '23 at 20:58
  • Thank you very much for pointing the reference out! I will make sure not to answer to low quality questions. – Matija Jan 14 '23 at 21:09
  • 1
    prove case 1:

    $$;gcd(x,y)=d \implies gcd(x,x+y)=d$$

    $$gcd(x,y)=d$$ $$\implies d|x ;et ; d|y \implies d|x+y$$ Then $$d | x ; et ; d| x+y$$ then $$gcd(x,y)=d\implies gcd(x,x+y)=d$$

    prove case 2 :

    $$\gcd(x,x+y)=d \implies gcd(x,y)=d$$

    $$gcd(x,x+y)=d \implies d|x ; et ; d|x+y ; d | y $$ then $$ d | x ; et ;d |y $$ Then $$gcd(x,x+y) =d\implies gcd(x,y)=d$$

    Finally case1 et case 2 then

    $$gcd(x,y)=gcd(x,x+y)=d$$

    – Moustapha_M_I Jan 14 '23 at 21:09