Given $a,\,b\in\mathbb{Z}$ relatively primes and $\,n \gt 0$, $n\in\mathbb{Z}$, calculate a) $\gcd(a+nb,a+(n+1)b)$; b) $\gcd(a+nb,a+(n+2)b)$. I was able to solve part a), proving by Mathematical Induction on $\,n\,$ that $\,\gcd(a+nb,a+(n+1)b) = 1$. (I can supply my solution if of interest).
However, I did'nt succeeded in tackling part b). Clearly, $\,n\,$ and $\,n+2\,$ always have the same parity, but noting this wasn't enough for me to find a solution. On the other side, I have performed a few numerical experiments that led me to suspect $\,\gcd(a+nb,a+(n+2)b)\,$ is equal to


*

*1 if $\,a\,$ is odd and $\,b\,$ is even, with any $\,n > 0$;

*1 is $\,a\,$ is even and $\,b\,$ is odd, with $\,n\,$ odd;

*2 if $\,a\,$ is even and $\,b\,$ is odd, with $\,n\,$ even;

*1 is $\,a\,$ is odd and $\,b\,$ is odd, with $\,n\,$ even;

*2 is $\,a\,$ is odd and $\,b\,$ is odd, with $\,n\,$ odd;


I would appreciate any help in proving or disproving this conjecture. 
 A: $$\gcd(a+nb,a+(n+2)b)= \gcd(a+nb,2b).$$ Since $b$ is coprime to $a$ it is also coprime to $a+nb$ and therefore $$\gcd(a+nb,2b)= \gcd(a+nb,2).$$ The required gcd is therefore $1$ if $a+nb$ is odd and $2$ if $a+nb$ is even. 
A: Using the Euclid algorithm, I have: $GCD(a+nb,a+(n+2)b)=GCD(a+nb,2b)$. If $a$ is odd and $b$ is even with $n>0$ write $a=2k+1$ with $k\in N$ and $b=2i$ with $i\in N$, I obtain: $$GCD(a+nb,2b)=GCD(2k+1+2in,4i)=1$$
In fact the first term is odd the second term is even.
If $a$ is even $a=2i$ with $i\in N$ and $b,$ are odd: $b=2k+1$ and $n=2j+1$. I have: $$GCD(a+nb,2b)=GCD(2i+(2k+1)(2j+1),2(2k+1))=1$$
In fact the first term is odd and the second even.
If $a=2k$, $b=2i+1$ and $n=2j$, I obtain: $$GCD(a+nb,2b)=GCD(2k+2j(2i+1),2(2i+1))=2$$
Because $2i+1\nmid k+j(2i+1)$, $\forall i,j,k \in N$.
If $a=2k+1$, $b=2i+1$ and $n=2j$, I obtain:
$$GCD(a+nb,2b)=GCD(2k+1+2j(2i+1),2(2i+1))=1$$
In fact $a+nb$ is always oddwhile $2(2i+1)$ is even.
If $a=2k+1$, $b=2i+1$ and $n=2j+1$, I have:
$$GCD(a+nb,2b))GCD(2k+1+(2i+1)(2j+1),2(2i+1))=2$$
In fact $2k+1+(2i+1)(2j+1)$ is always an even number, so the $GCD$ is $2$.
A: If $p$ is a prime which divides $a+nb$ and $a+(n+1)b$, it divides $a+(n+1)b-(a+nb)=b$, it divides $nb$ and $(a+nb)-nb=a$ contradiction since $gcd(a,b)=1$. We deduce that $gcd(a+nb, a+(n+1)b)=1$.
If $p$ divides $a+nb$ and $a+(n+2)b$, $p$ divides $a+(n+2)b-(a+nb)=2b$.
If $p$ is odd, $p$ divides $b$, $nb$ and $a+nb-nb=a$ contradiction. If $p=2$
$a+(n+2)b=a+nb+2b$ thus $a+nb$ is even, since $a$ and $b$ are odd, $nb$ is odd and $n$ is odd.
Thus if $n$ is odd $gcd(a+nb,a+(n+2)b)=2$ if it is even it is $1$.
