Skip to content

Instantly share code, notes, and snippets.

@Eskatrem
Created August 22, 2011 23:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Eskatrem/1163944 to your computer and use it in GitHub Desktop.
Save Eskatrem/1163944 to your computer and use it in GitHub Desktop.
(fn [x n]
(loop [res (), k 0]
(cond (>= k n) (if (list? x) res (reverse res))
:else (recur (conj res (filter #(= k (mod % n)) x)) (inc k)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment