Prove that if $a$ and $b$ are relatively prime, then $\gcd(a+b, a-b) = 1$ or $2$ [duplicate]

Solution 1:

HINT:

Let $d$ divides both $a+b$ and $a-b$

$\implies d $ divides $a+b+a-b=2a$ and $a+b-(a-b)=2b$

$\implies d $ divides $(2a,2b)=2(a,b)=2$

Solution 2:

If $ax+by=1$ then $$\begin{align}2&=2ax+2by \\&=(a-b)x + (a+b)x + (b-a)y+(b+a)y \\&= (a-b)(x-y)+(a+b)(x+y)\end{align}$$

Solution 3:

Here are two solutions that use the euclidean algorithm more directly:

(1) $\gcd(a+b,a-b) = \gcd(a+b,2a) \mid \gcd(2(a+b),2a) = \gcd(2b,2a) = 2·\gcd(b,a)$.

(2) $\gcd(a+b,a-b) = \gcd(a+b,2a) \mid \gcd(a+b,2)·\gcd(a+b,a) \mid 2·\gcd(b,a)$.