Solution
= Solution
Multiplication, followed by <induction> and inversion for negative powers, gives
$$
\boxed{T^n=\begin{pmatrix}1&n\\0&1\end{pmatrix}},\qquad
T^nX=\begin{pmatrix}a+nc&b+nd\\c&d\end{pmatrix}.
$$
If $c\ne0$, apply <Euclidean division> to write $a=q|c|+r$ with $0\leq r<|c|$. Choose $n=-q\operatorname{sgn}(c)$, so $a+nc=r$. This is one step of the <Euclidean algorithm> implemented by a determinant-one row operation.