 The sequence ends when there is no residual rectangle, i.e., when the square tiles cover the previous residual rectangle exactly.The length of the sides of the smallest square tile is the GCD of the dimensions of the original rectangle.For example, the smallest square tile in the adjacent figure is 21-by-21 (shown in red), and 21 is the GCD of 1071 and 462, the dimensions of the original rectangle (shown in green).