1 ! Copyright (c) 2007 Aaron Schaefer, Samuel Tardieu.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: math.primes sequences ;
6 ! http://projecteuler.net/index.php?section=problems&id=10
11 ! The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
13 ! Find the sum of all the primes below two million.
19 : euler010 ( -- answer )
20 2000000 primes-upto sum ;
23 ! 266425 ms run / 10001 ms GC time
25 ! TODO: this takes well over one minute now that they changed the problem to
26 ! two million instead of one. the primes vocab could use some improvements