Skip to content

Instantly share code, notes, and snippets.

@cdemyanovich
cdemyanovich / euler.clj
Last active December 29, 2015 02:49
Solutions to 3 Project Euler problems for Clojure 101 at 8th Light.
(ns euler.core)
(defn multiple-of-3-or-5? [n] (or (= 0 (mod n 3)) (= 0 (mod n 5))))
(defn sum-of-multiples-of-3-or-5-below [n]
(apply + (filter multiple-of-3-or-5? (range 1 n))))
(defn fibs []
(map first (iterate (fn [[a b]] [b (+ a b)]) [1N 1N])))