QUESTION IMAGE
Question
sage.
- prove that \\(\gcd(a, a + 2) = 1\\) if \\(a\\) is odd and \\(\gcd(a, a + 2) = 2\\) if \\(a\\) is even.
Step1: Recall gcd property
Let $d = \gcd(a, a+2)$. By the property of gcd, $d$ divides $(a+2)-a$.
Step2: Simplify the difference
$(a+2)-a = 2$, so $d$ divides 2. Thus, $d=1$ or $d=2$.
Step3: Case 1: $a$ is odd
If $a$ is odd, $a$ is not divisible by 2. So $d$ cannot be 2, so $d=1$. Thus $\gcd(a,a+2)=1$.
Step4: Case 2: $a$ is even
If $a$ is even, $a=2k$ for integer $k$, and $a+2=2(k+1)$. Both are divisible by 2, so $d=2$. Thus $\gcd(a,a+2)=2$.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
Proven that $\gcd(a,a+2)=1$ when $a$ is odd, and $\gcd(a,a+2)=2$ when $a$ is even.