Skip to content

Instantly share code, notes, and snippets.

@tomjack tomjack/12.clj Secret
Created Dec 1, 2009

Embed
What would you like to do?
(defn triangle-numbers
([]
(triangle-numbers 1 0))
([i total]
(let [newtotal (+ total i)]
(lazy-seq (cons newtotal (triangle-numbers (inc i) newtotal))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.