I have been reviewing Bill Dubuque's explanation of a forward version of the extended Euclidean algorithm in another question. I have seen other explanations of this method on the internet, but Bill's explanation was the only one that gave a logical reason for the addition of extra variables, i.e., using matrix operations to keep "track of each remainder's expression as a linear combination of the gcd arguments."
Here is my question: Bill stops the process when the remainder is 1 or -1. Usually in the Euclidean algorithm, we don't stop until the remainder is zero, so we know that the gcd is the remainder of previous step. Is it merely that, being $\pm 1$, the next step must have a remainder of 0?
I also find it easier to write out the problem of, say gcd(141,19) in this way:
$ \begin{align} R1:& &1& &0& &|& &141& &141=& \; 7\cdot 19+8& \;\;\;\;\;\; R1-7R2 &\to R3& \\ R2:& &0& &1& &|& &19& &19=& \; 2\cdot 8+3& \;\;\;\;\;\; R2-2R3 &\to R4& \\ R3:& &1& &-7& &|& &8& &8=& \; 2\cdot 3+2& \;\;\;\;\;\; R3-2R4 &\to R5& \\ R4:& &-2& &15& &|& &3& &3=& \; 1\cdot 2+1& \;\;\;\;\;\; R4-R5 &\to R6& \\ R5:& &5& &-37& &|& &2& &2=& \; 2\cdot 1+0& \;\;\;\;\;\; R5-2R6 &\to R7& \\ R6:& &-7& &52& &|& &1& \\ R7:& &19& &-141& &|& &0& \end{align} $
So that the gcd(141, 19) = 1, and the linear combination of 141 and 19 to equal 1 is: $-7\cdot 141+52\cdot 19=1$.
Because I am still learning these methods, I prefer not to skip any steps. Otherwise, I think I understand the method.
$$\left[ \begin{array}{r} -7 & 52\ 19 &!! -141\end{array}\right ] \left[ \begin{array}{r} 141 & 1 & 0\ 19 & 0 & 1\end{array}\right ] \ =\ \left[ \begin{array}{r} \color{#c00}1\ & \color{#c00}{-7}\ & \color{#c00}{52}\ \color{#0a0}0\ & \color{#0a0}{19}\ &!!! \color{#0a0}{-141}\end{array}\right] \qquad\qquad\qquad\qquad\qquad\qquad$$
– Bill Dubuque Jun 26 '24 at 19:50