-1

Using the Euclid's algorithm, find the gcd($4n$,$2n+1$) for $n \in N$ and express it as a linear combination of $4n$ and $2n+1$.

I started by testing different values for n:

$n = 1$ $\rightarrow$ gcd($4(1)$,$2(1)+1$) = 1

$n = 2$ $\rightarrow$ gcd($4(2)$,$2(2)+1$) = 1

$n = 3$ $\rightarrow$ gcd($4(3)$,$2(3)+1$) = 1

.

.

.

You can see that $2n+1$ is going to be the odd numbers, but I don’t know how to associate this with Euclid's algorithm.

And with respect to the linear combination I just know it can be the way:

For $4n = (2n+1)(?)+??$ and for $2n+1 = (2n-1)(?)+??$

but I don’t know how to go on, I hope you can help me :)

Roy M
  • 67
  • 1
    $4n$ is even and $2n+1$ is odd so their $\gcd$ will always be odd – p_square Jul 10 '21 at 05:09
  • Easier, as here we can lift an easy inverse $\bmod 2n,$ to $\bmod (2n)^2,,$ yielding

    $$\begin{align} \bmod \color{#c00}{(2n)^2}!:,\ \dfrac{1}{1+2n}\equiv \dfrac{1-\color{#c00}{(2n)^2}}{1+2n}\equiv 1-2n\[.7em] \text{so Bezout is},\ \ (1-2n)(1+2n) , =, 1 - n(4n) \end{align}\qquad$$

    This can be viewed as lifting an easy inverse $!\bmod 2n,$ to $!\bmod (2n)^2,$ by Newton's method (Hensel lifting)

    – Bill Dubuque Jul 10 '21 at 11:51

3 Answers3

1

An elementary approach

Let's define $gcd(4n, 2n+1)=d$,

Then by definition of the greatest common divisor, it follows that

$$d \mid 4n\,\,\,\ , d\mid 2n+1$$

Therefore $d \mid -4n+2(2n+1)=2$ from which it follows that $d=1$

( $d \mid 2n+1$ , forces $d=1$)

Alternatively we can just write $$gcd(4n,2n+1)=gcd(-2,2n+1)=1$$, as the terms under consideration have the opposite parity

A S D
  • 356
0

Well, $\frac{4n}{2n+1}<2$, so our first multiplicand must be $1$: $$4n=(2n+1)(1)+(2n-1)$$ Same with our second: $$2n+1=(2n-1)(1)+2$$ Then $$2n-1=2(n-1)+1$$ So our GCD is $1$

Rhys Hughes
  • 12,842
0

$$4n = 1\cdot (2n+1)+(2n-1)$$ $$2n+1=1\cdot (2n-1)+2$$ $$2n-1=(n-1)\cdot 2+1$$

By backward substitution, $$1=(2n-1)-(n-1)\cdot 2$$ $$\Rightarrow 1=(2n-1)-(n-1)\cdot((2n+1)-1\cdot (2n-1))$$$$\Rightarrow 1=1\cdot (2n-1)-(n-1)\cdot (2n+1)+(n-1)\cdot (2n-1)$$ $$\Rightarrow 1=n\cdot (2n-1)-(n-1)\cdot (2n+1)$$ $$\Rightarrow 1=n\cdot (4n-1\cdot (2n+1))-(n-1)\cdot (2n+1)$$ $$\Rightarrow 1=n\cdot (4n)-n\cdot (2n+1)-(n-1)\cdot (2n+1)$$ $$\Rightarrow 1=n\cdot (4n)-(2n-1)\cdot (2n+1),$$ which expresses $1=\gcd(4n,2n+1)$ as a linear combination of $4n$ and $2n+1$.

Remark. The fact $1=\gcd(4n,2n+1)$ can be seen directly without the Division Algorithm. For example, let $d=\gcd(4n,2n+1)$. Then for any prime divisor $p~|~d$, $p$ must divide $4n$, so either $p=2$ or $p~|~n$. For each case, $p~\nmid (2n+1)$. It follows that $d=1$.

Pythagoras
  • 7,079
  • 1
    Easier by Newton's method - see my comment on the question. You did the extended Euclidean algorithm backward, which is more work and more error prone than doing it forward. – Bill Dubuque Jul 10 '21 at 11:55