PageRenderTime 102ms CodeModel.GetById 98ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/extra/project-euler/020/020.factor

http://github.com/abeaumont/factor
Unknown | 25 lines | 16 code | 9 blank | 0 comment | 0 complexity | 88fecd320dbbffb780a061c9d7d48d84 MD5 | raw file
 1! Copyright (c) 2007, 2008 Aaron Schaefer.
 2! See http://factorcode.org/license.txt for BSD license.
 3USING: math.combinatorics project-euler.common sequences ;
 4IN: project-euler.020
 5
 6! http://projecteuler.net/index.php?section=problems&id=20
 7
 8! DESCRIPTION
 9! -----------
10
11! n! means n * (n - 1) * ... * 3 * 2 * 1
12
13! Find the sum of the digits in the number 100!
14
15
16! SOLUTION
17! --------
18
19: euler020 ( -- answer )
20    100 factorial number>digits sum ;
21
22! [ euler020 ] 100 ave-time
23! 0 ms ave run time - 0.55 (100 trials)
24
25SOLUTION: euler020