Got it down to still very slow 100 seconds by using the vec function on the sieved result to make it a vector instead of a linked list. This way the nth call inside the recur statement is way faster.
(defn luckies [n]
(loop [working-set (range 1 (inc n))
(if (< ln (count working-set))
(let [new-ws (vec
(fn [ix item]
(when (not= 0 (mod (inc ix) ln)) item))
(recur new-ws (nth new-ws step) (inc step)))
(println (count working-set)))))
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.