Solution using Clojure iterate function