$\gcd(a^2, b)$ such that $a$ is even and $b=2a$

181 Views Asked by At

I am trying to grasp basic concepts of number theory, I would like to know if my reasoning is correct. When attempting to find the $\gcd(a, b)$ where $a = n^2$ and $b = 2n$ such that $n$ is odd, I first express $n$ as an odd integer in terms of $k$, $$n = 2k + 1 : k \in \Bbb Z^+ $$ then I express $a$ and $b$ in terms of $n = 2k + 1$ $$a = n^2 = (2k + 1)^2$$ $$b = 2n = 2(2k + 1)$$ and then I apply the Euclidean algorithm to find $\gcd\left((2k + 1)^2, 2(2k + 1)\right)$, $$(2k + 1)^2 = (4k + 2)(k) + (2k + 1)$$ $$(4k + 2) = (2k + 1)(2) + 0$$ $$\therefore \quad \forall\; n = 2k + 1:k\in\Bbb Z^ + , \; \gcd(n^2,\, 2n) = n$$


Trying the other case when $n$ is even I express it as $$n = 2k:k\in\Bbb Z^ + $$ such that $a$ and $b$ in terms of $n = 2k$ gives $$a = n^2 = (2k)^2$$ $$b = 2n = 2(2k)$$ and apply the Euclidean Algorithm for $\gcd\left((2k)^2, 2(2k)\right)$ $$(2k)^2 = 2(2k)(k) + 0$$ This result is a bit unclear to me since this is all new material, what does that result tell me about the $\gcd$ if the algorithm goes to zero in the first step?

From divisibility, I see this as $k\;|\;(2k)^2$ such that $\frac {(2k)^2}k = 2(2k) = 2n$ from which I would claim that $$\forall\; n = 2k : k\in \Bbb Z^ + , \;\gcd(n^2, 2n) = 2n$$ Is this a correct reasoning about the relation between the divisibility, the Euclidean algorithm and the $\gcd$?

2

There are 2 best solutions below

5
On BEST ANSWER

It's a bit simpler than that.

we know that if $a = n^2$ and $b = 2n$ that $n$ is a common divisor.

$a = n*n; b = 2*n$ so if there is any other common factor it will be a common factor of $2$ and $n$.

But as $n$ is odd there is no common divisor between $2$ and $n$ so the greatest common divisor is $n$.

This all hinges on understanding that

Lemma: $\gcd(c*m, d*m) = m\gcd(c,d)$

And therefore $\gcd(a,b) = \gcd(n^2, 2n) = n\gcd(2,n) = n*1 = n$ (as $n$ is odd).

0
On

Yes, $gcd(a, b) =b$ in this case, because as $n=2k$ then $b=4k|4k^2=a$.