Skip to content

Instantly share code, notes, and snippets.

@jaredbranum
Created October 5, 2012 20:45
Show Gist options
  • Save jaredbranum/3842278 to your computer and use it in GitHub Desktop.
Save jaredbranum/3842278 to your computer and use it in GitHub Desktop.
lazy pascal sequence in clojure (10-05-2012 code golf)
(def pascal((fn p[x](lazy-seq(cons x(p(concat((fn [y](map-indexed(fn [i e](if(> i 0)(+ e(nth y(dec i)))1))y))x)[1])))))'(1)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment