(let loop[[D 0][N (read)]] (when (zero? N) (print D) (exit)) (loop (+ D 1) (+ N -1 (if (= 6 (mod D 7)) 6 0))))