Calculating $\gcd(n+2,n)$

88 Views Asked by At

How would I go about finding $\gcd(n+2,n)$. I have managed to show that $\gcd(n+1,n)$ is $1$ which was pretty straight forward however we have only been taught the euclidean algorithm for computing gcd and it doesn't seem suitable for $n+2,n$. I have a feeling I need to make some statements before hand regarding n being even?

3

There are 3 best solutions below

4
On BEST ANSWER

$$\gcd(n+2,n)=\gcd(n+2-n, n)=\gcd(2,n)$$

Now consider cases, what if $n$ is even, what if $n$ is odd.

0
On

Hint:

If $d$ divides $n+2$ and $n$ then it also divides $2=(n+2)-n$ so for common positive divisors there are at most two possibilities: $d=1$ or $d=2$.

0
On

Hint :

$$n+2=n\cdot 1+2$$

$$n=2\cdot a +0 \text{ or } 1$$

For some $a \text { in } \mathbb N$