Euclidean algorithm
using the Euclidean algorithm to calculate the greatest common divisor.