Returns the least common multiple of a list of numbers.
lcm(x, y) = x * y / gcd(x, y)over the given list.
from functools import reduce from math import gcd def lcm(numbers): return reduce((lambda x, y: int(x * y / gcd(x, y))), numbers)
lcm([12, 7]) # 84 lcm([1, 3, 4, 5]) # 60
Calculates the greatest common divisor of a list of numbers.
Converts a number to a list of digits.
Initializes a list containing the numbers in the specified range where
end are inclusive and the ratio between two terms is