Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,13 @@
|
|||
(def fibs (lazy-cat [1 1] (map + fibs (rest fibs))))
|
||||
|
||||
(defn z [n]
|
||||
(if (zero? n)
|
||||
"0"
|
||||
(let [ps (->> fibs (take-while #(<= % n)) rest reverse)
|
||||
fz (fn [[s n] p]
|
||||
(if (>= n p)
|
||||
[(conj s 1) (- n p)]
|
||||
[(conj s 0) n]))]
|
||||
(->> ps (reduce fz [[] n]) first (apply str)))))
|
||||
|
||||
(doseq [n (range 0 21)] (println n (z n)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue