Skip to content

Instantly share code, notes, and snippets.

@mwmitchell
Created February 9, 2012 15:42
Show Gist options
  • Save mwmitchell/1780728 to your computer and use it in GitHub Desktop.
Save mwmitchell/1780728 to your computer and use it in GitHub Desktop.
divisions
(defn divisions [n t]
(loop [nn n nt t z []]
(let [q (quot nn nt) nz (concat z [q])]
(if (> nt 1)
(recur (- nn q) (dec nt) nz)
nz))))
(divisions 10 8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment