$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$?
This question can simply be restated as: find the LCM (lowest common multiple) of the first 20 natural numbers starting from 1. Thankfully python has a built-in function to compute the LCM of many numbers.
import math
l = list(range(1, 21))
print(math.lcm(*l))
Explained line by line:
math library, which provides various mathematical functions and constants.l that contains all the integers from $1$ to $20$ using the range function. The range(1, 21) generates numbers starting from $1$ up to (but not including) $21$.math.lcm function to compute the lowest common multiple (LCM) of all the numbers in the list l. The asterisk (*) before l is used to unpack the list, passing each element as a separate argument to the lcm function. We then print the result, which is the smallest positive number that is evenly divisible by all of the numbers from $1$ to $20$.Running the above code leads to an answer of $232792560$