This problem is from my discrete mathematics textbook.
I'm trying to find $\gcd(420,66)$
I compute $$\begin{align*} 420 &= 6 \times 66 + 24\\ 66 &= 2\times 24 + 18\\ 24 &= 1 \times 18 + 6\\ 18 &= 3 \times 6 + 0 \end{align*}$$ then I rewrite the equation $$\begin{align*} 6 &= 24 - 1 \times 18\\ 18 &= 66 - 2 \times 24\\ 24 &= 420 - 6 \times 66\\ \end{align*}$$
Now I try to perform substitutions which give me $$\begin{align*} 6 &= 24 -1 \times 18\\ & = 24-1 (66 - 2 \times 24)\\ &= 3 \times 24 -66 \end{align*}$$
My question is how do you transition from $$ 24-1 (66 - 2 \times 24)$$ to $$3 \times 24 -66$$
I just can't wrap my head around this part. Maybe I'm way over thinking this step.
Any help is appreciated thanks!