Solve problem 137 in 4clojure.com, calculating digits for different bases.