Codewars Hamming Numbers https://www.codewars.com/kata/hamming-numbers/train/clojure. A demo of sort-merge and recursive lazy seqs
(defn sort-merge [colls]
(if (<= (count colls) 1)
(first colls)
(let [mi (apply min (map first colls))]
(cons mi
(lazy-seq
(->> (map (fn [[f & r :as coll]]
(if (= f mi) r coll))
colls)
(filter some?)
sort-merge))))))
;(take 20 (sort-merge [(iterate (partial * 2) 1) (iterate (partial * 3) 1)]))
(def hams
(cons 1
; (lazy-seq
(sort-merge
[(map (partial * 2) hams)
(map (partial * 3) hams)
(map (partial * 5) hams)])))
(take 50 hams)