Skip to content

Instantly share code, notes, and snippets.

@foogoof
Created March 16, 2010 03:28
Show Gist options
  • Save foogoof/333604 to your computer and use it in GitHub Desktop.
Save foogoof/333604 to your computer and use it in GitHub Desktop.
(let [fibs (iterate (fn [[a b]] [b (+ a b)]) [0 1])
just-the-fibs (take-while #(> 4e6 (apply max %)) fibs)]
(reduce (fn [sum [_ r]] (+ sum (if (even? r) r 0)))
0
just-the-fibs))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment