projects
/
sandbox
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Weird factorization algorithm.
[sandbox]
/
project-euler
/
20.clj
1
(defn factorial [n]
2
(if (= n 1)
3
1
4
(* n (factorial (- n 1)))))
5
6
(defn sum-digits [radix n]
7
(if (= n 0)
8
0
9
(+ (rem n radix) (sum-digits radix (quot n radix)))))
10
11
12
(println (sum-digits 10 (factorial 100)))