Let $m$ and $n$ be positive integers such that $m = 24n + 51$. What is the largest possible value of the greatest common divisor of $2m$ and $3n$?
I'm trying to figure out how to use the Euclidean algorithm here, but I don't know where to start. I have that $2m=48n+102$ and $3n=\frac{m-51}{8}$.
The solution for this problem was the following
\begin{align*} \text{gcd}(2m, 3n) &= \text{gcd}(2m-3n\cdot16, 3n) \\ &= \text{gcd}(2\cdot(24n+51)-48n, 3n) \\ &= \text{gcd}(102, 3n) \\ &\leq 102. \end{align*}
but I don't understand the steps here... Where do all the equalities come from?