1 ! Copyright (c) 2007, 2008 Aaron Schaefer.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: math.combinatorics project-euler.common sequences ;
6 ! http://projecteuler.net/index.php?section=problems&id=20
11 ! n! means n * (n - 1) * ... * 3 * 2 * 1
13 ! Find the sum of the digits in the number 100!
19 : euler020 ( -- answer )
20 100 factorial number>digits sum ;
22 ! [ euler020 ] 100 ave-time
23 ! 0 ms ave run time - 0.55 (100 trials)