If $\gcd (x,4) = 2$ and $\gcd(y,4) = 2$ then $\gcd(x+y,4) = 4$

I was working my way through some number theoretic proofs and being a newbie am stuck on this problem :

If $(x, 4) = 2$ and $(y, 4) =2$, then $(x + y, 4) = 4$, where $(a,b)$ denotes the greatest common divisor of $a$ and $b$.

My Solution (Incorrect)

  • $x-4 = 2t$
  • $y-4 = 2p$
  • $x + y - 8 = 2(t+p) \Rightarrow x + y - 4 = 2f + 4 = 2(f+2)\Rightarrow 2$ divides $(x+y , 4)$

My Question:

My solution is definitely inadequate. Can someone help me out?


Solution 1:

HINT:

$x$ has to be one of the forms $:4t,4t+1,4t+2,4t+3$ where $t$ is some integer

As $(x,4)=2,x=4t+2$

Solution 2:

You know that $x=2a$ and $y=2b$, with odd $a$ and $b$. Thus $$ x+y=2(a+b) $$ and $a+b$ is even. Thus $x+y$ is divisible by $4$.