Basic algorithms in Clojure