3

Let $a$ and $b$ be relatively prime positive integers and write the two minimal Bézout's identity pairs,

$\tag 1 (s)\,a + (t)\,b = 1$

$\tag 2 (u)\,a + \;(v)\,b = 1$

where the extended Euclidean algorithm produces one of them
(see this discussion on the structure of solutions).

Set $\quad \; \; x = s - 1$ if $s \gt 0$,
else set $x = u-1$

Set $\quad \; \; y = t - 1$ if $t \gt 0$,
else set $y = v-1$

Let $n = ab - a - b$ be the solution to the Frobenius coin problem for $a$ and $b$.

Conjecture: The numbers $x$ and $y$ derived from the extended Euclidean algorithm satisfy the equation $n + 1 = (a-1)(b-1) = (x)\,a + (y)\,b$

My Work

I noticed this relationship occured while working on this and that (not spelled out in this answer).

Here is another example.

Let $a = 227$ and $b =2011$ and write

$\tag{Z1} (-691)\,227 + (78)\,2011 = 1$

$\tag{Z2} (1320)\,227 + \;(-149)\,2011 = 1$

and $x = 1319$ and $y = 77$.

The statement

$ (1319)\,227 + \;(77)\,2011 = 227\cdot2011 - 227 - 2011 + 1$

is true.


If the conjecture is true one could use the connection to calculate Bézout's coefficients
(in the coprime setting) with new algorithms.

Example: Use an ad-hoc method (algorithm?) to solve for $x$ and $y$ in the equation

$\quad (x)\,227 + \;(y)\,2011 = 227\cdot2011 - 227 - 2011 + 1$

Examining

$\quad 227\cdot2011 - 227 - 2011 + 1 = (2011)\, 227 - 2237$

the problem is reduced to solving

$\quad 227 k \equiv 2237 \pmod{2011}$

That gives $k \equiv 692 \pmod{2011}$ and

$\quad (2011)\, 227 - 2237 =$
$\quad (2011 -692)\, 227 + 692\cdot227 - 2237 =$
$\quad (1319)\, 227 + 154847$

Now use our 'best' algorithm for dividing (exactly) $2011$ into $154847$,

$\quad \large \frac{154847}{2011} = 77$

so

$\quad (1319)\, 227 + 154847 =$
$\quad (1319)\, 227 + (77) \, 2011 $

and we can now easily calculate Bézout's coefficients by solving the linear equations

$\quad (z)\,227 + (78)\,2011 = 1$

and

$\quad (1320)\,227 + (z)\,2011 = 1$

CopyPasteIt
  • 11,366
  • 1
    Let $c,d$ be nonnegative integers such that $ab - a - b + 1 = ca + db$. Then $0 \leqslant c \leqslant b-1$, $0 \leqslant d \leqslant a-1$, and $ca \equiv 1 - a \pmod{b}$, $db \equiv 1-b \pmod{a}$. These constraints are also satisfied by $x$ and $y$. – Daniel Fischer Dec 14 '20 at 21:24
  • I found this answer by @robjohn that gets this into the right ballpark. – CopyPasteIt Dec 19 '20 at 10:34
  • @CopyPasteIt: Did you mean $n + 1 = (a-1)(\color{#C00}{b}-1) = (x),a + (y),b$? – robjohn Dec 19 '20 at 13:55
  • 1
    @CopyPasteIt: you say that one pair is obtained directly; how is the other obtained? – robjohn Dec 19 '20 at 13:59
  • @robjohn I updated my question - I should have said 'the two minimal pairs'. of solutions. – CopyPasteIt Dec 20 '20 at 02:23

1 Answers1

1

If the solution from the Extended Euclidean Algorithm is $$ sa+tb=1 $$ then, since $(a,b)=1$, the other minimal solution is $$ (s\mp b)a+(t\pm a)b=1\qquad{s>0\atop s<0} $$ If $s\gt0$, then $x=s-1$ and $y=t-1+a$; thus, $$ \begin{align} xa+yb &=(s-1)a+(t-1+a)b\\ &=ab-a-b+1 \end{align} $$ If $s\lt0$, then $x=s-1+b$ and $y=t-1$; thus, $$ \begin{align} xa+yb &=(s-1+b)a+(t-1)b\\ &=ab-a-b+1 \end{align} $$ So what you want is true.

robjohn
  • 345,667