Remark

The loop can be described rather conveniently in matrix form: The vector (a,b)T is replaced by M(a,b)T, where

M =
01
1-q

Here, q is the quotient of division of a by b.