I am currently learning number theory and specifically greatest common divisors. I was reading a solution to the following problem:
The numbers in the sequence $101,104,109,116,\ldots$ are of the form $a_n = 100+n^2$ , where $n = 1,2,3, ... $ for each $n$. let $d_n$ be the greatest common divisor of $a_n$ and $a_{n+1}$. Find the maximum value of $d_n$ as $n$ ranges through the positive integers.
And the solution was as follows (I have numbered the lines so that it would be easily referred to) :-
- $\gcd(100 + n^2, 100 + (n+1)^2)$
- $\gcd(100 + n^2, 100 + (n+1)^2-100-n^2)$
- $\gcd(100 + n^2, 2n+1)$
- $\gcd(200 + 2n^2, 2n+1)$
- $\gcd(200 + 2n^2 -n(2n+1), 2n+1)$
- $\gcd(200 - n, 2n+1)$
- $\gcd(400 - 2n, 2n+1)$
- $\gcd(401, 2n+1)$
The answer is $401$, which is obtained when $n = 200$
My question is if $\gcd(a,b) = \gcd(2a,b)$ is true as this has been repeated twice on the lines 4 and 7? And if this is not true, I would like an explanation for both steps. Thanks!
In general the answer is no. $1=\gcd(3,2)\neq \gcd(2\cdot 3,2)=2$.
But if $b$ is odd, the answer is yes (and in your case, $2n+1$ is odd).
In general, $\gcd(a,b)=\operatorname{gdc}(a\cdot k,b)$ if $\gcd(k,b)=1$