Solve problem 24 using Clojure.