Skip to content

Instantly share code, notes, and snippets.

@amalloy
Created August 16, 2012 23:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amalloy/349eb71c83e9bd98d04c to your computer and use it in GitHub Desktop.
Save amalloy/349eb71c83e9bd98d04c to your computer and use it in GitHub Desktop.
(fn [s e]
(->> [[s]]
(iterate #(mapcat (fn [[c :as p]]
(for [f [* / +]
:let [n (f c 2)]
:when (integer? n)]
(cons n p)))
%))
(map #(filter (comp #{e} first) %))
(filter seq)
ffirst
count))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment