Euler Problem 5

2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.

What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?


In [1]:
from math import gcd
from functools import reduce

lcm = lambda m, n: m * n // gcd(m, n)
print(reduce(lcm, range(1, 21)))


232792560

In [ ]: