Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Euclidean algorithm, recursion solution in Clear category for The Greatest Common Divisor by vinc
def greatest_common_divisor(*args):
gcd = min(args)
remainders = [i % gcd for i in args if i % gcd]
if remainders:
return greatest_common_divisor(gcd, *remainders)
else:
return gcd
Aug. 27, 2014