Project Euler : Problem 5



Problem

Link to problem page

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 with no remainder by all of the numbers from 1 to 20?

Solution

The answer is: 232792560
The execution took: 0.19999998807907104 milliseconds
Use "inspect source" to see the source code

Explanation

Get the sets of prime factors and their powers for of all the integers between 2 and 20. For each prime factor, find the highest power used in making each integer. The result is the product of all the prime factors raised to their highest used powers.

Comments

Popular Posts