Euclidean algorithm
If is replaced by when , then one gets a variant of Euclidean algorithm such that