Euclidean algorithm
A sequence satisfying these requirements is obtained using the Euclidean algorithm, which is as follows: