1 ! Copyright (c) 2007, 2009 Aaron Schaefer.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: math project-euler.common ranges sequences ;
6 ! https://projecteuler.net/problem=5
11 ! 2520 is the smallest number that can be divided by each of the
12 ! numbers from 1 to 10 without any remainder.
14 ! What is the smallest number that is evenly divisible by all of
15 ! the numbers from 1 to 20?
21 : euler005 ( -- answer )
22 20 [1..b] 1 [ lcm ] reduce ;
24 ! [ euler005 ] 100 ave-time
25 ! 0 ms ave run time - 0.14 SD (100 trials)