Problem 5 - Smallest Multiple

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?
The Idea

This is equivalent to the problem of finding the least common multiple of numbers from 1 to 20. Stated differently, we are finding the least amount of times we need to include each prime in the prime factorization. For example,24=162^4 = 16 is the most number of times we have a factor of 2. While 3 has a max power of 2 under 20, and all primes greater than 3 have a maximum power of 1. Therefore, we multiply 242^4 by 323^2 and all of the other primes greater than 3 but less than 20 to find the final answer.
The Code


The full utils module can be found on GitHub here

© Jack Moody 2020