Skip to content

Commit 030a0fd

Browse files
committed
doc: explain method.
1 parent 675fd58 commit 030a0fd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Project-Euler/Problem005.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ import { PrimeFactors } from '../Maths/PrimeFactors.js'
44
* Smallest Multiple
55
* @link https://projecteuler.net/problem=5
66
*
7-
* 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
7+
* 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?
88
*
9-
* What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
9+
* Method: unique factorization
10+
* @link https://en.wikipedia.org/wiki/Least_common_multiple#Using_prime_factorization
11+
* The method used below calculates the Least Common Multiple (LCM) by multiplying the largest powers of the prime factors of the divisors. For example, 8 is the LCM of 2, 4, and 8. The prime factors of these numbers are 2^1, 2^2, and 2^3. We can discard 2^1 and 2^2 since 2^3 is the largest power of 2, leaving us with a result of 2^3 (8).
1012
*/
1113

1214
export function findSmallestMultiple(maxDivisor) {

0 commit comments

Comments
 (0)