Fun with algorithms, in Clojure