 Thus, the algorithm can be written as a sequence of equations

If "a" is smaller than "b", the first step of the algorithm swaps the numbers.For example, if "a" 0 equals zero, and the remainder "r"0 is "a".Thus, "r""k" is smaller than its predecessor "r""k"−1 for all "k" ≥ 0.