Last active
December 21, 2015 05:39
-
-
Save bretkoppel/6258756 to your computer and use it in GitHub Desktop.
Clojure solution to Project Euler problem 2.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn fib-even [] | |
(loop [x 0, y 1, acc 0] | |
(let [term (+ x y)] | |
(if (< y 4000000) | |
(recur y term (if (even? term) (+ acc term) acc)) | |
acc)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment