Two pairs of coprime numbers

73 Views Asked by At

Given two pairs of integers $(m,n)$ and $(m',n')$ such that $m$ and $n$ (resp. $m'$ and $n'$) are coprime.

Can we find a sequence of integer pairs $\{(m_1,n_1), (m_2,n_2),\cdots, (m_k,n_k)\}$ so that $(m_1,n_1)=(m,n)$, $(m_k,n_k)=(m',n')$, and $m_i n_{i-1}-m_{i-1}n_i=\pm 1$ for $2 \le i \le k$.

1

There are 1 best solutions below

0
On

Illustration of basic idea with $(m_1,n_1) = (11,29);\ (m_2,n_2) = (57,44):\ $

Stage $1$: $(11,29) \to (8,21) \to (3,8) \to (1,3)\to (1,2)\to (1,1)$

Stage $2$: $(57,44) \to (22,17) \to (9,7) \to (4,3) \to (1,1).$

Stage $3$ (Putting Stage $1$ and Stage $2$ together): $(11,29) \to (8,21) \to (3,8) \to (1,3)\to (1,2)\to (1,1) \to (4,3) \to (9,7) \to (22,17) \to (57,44)$

To get to the next pair, for example $(57,44) \to (22,17),$ we can use Euclid's algorithm in reverse / Bézout's identity, which guarantees the numbers in the next pair will be smaller (I think- please confirm this in the comments), so we will eventually get to $(1,1)$ in both Stage $1$ and Stage $2$. There is no issue with an even vs odd number of steps as I originally thought.

Illustration of Euclid's algorithm for $57$ and $44:$

\begin{align}\\ 57 = 1\cdot 44 + 13\\ \\ 44 = 3\cdot 13 + 5\\ \\ 13 = 2\cdot 5 + 3\\ \\ 5 = 1\cdot 3 + 2\\ \\ 3 = 1\cdot 2 + 1\\ \\ 2 = 2\cdot 1\\ \\ \end{align}

Then reversing Euclid's algorithm to form the desired Bézout's identity for this example:

\begin{align}\\ \\ \gcd(57,44) = 1\\ \\ = 3 - 1\cdot 2\\ \\ = 3 - 1\cdot (5-3)\\ \\ = -1\cdot 5 + 2\cdot 3\\ \\ = -1\cdot 5 + 2\cdot (13 - 2\cdot 5)\\ \\ = 2\cdot 13 - 5\cdot 5\\ \\ = 2\cdot 13 - 5\cdot (44 - 3\cdot 13)\\ \\ = -5\cdot 44 + 17\cdot 13\\ \\ = -5\cdot 44 + 17\cdot (57- 1\cdot 44)\\ \\ = 17\cdot 57 - 22\cdot 44.\\ \\ \end{align}