Skip to content

Instantly share code, notes, and snippets.

@michalmarczyk
Created June 20, 2010 22:08
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 michalmarczyk/446158 to your computer and use it in GitHub Desktop.
Save michalmarczyk/446158 to your computer and use it in GitHub Desktop.
;;; implementation of Rob Lachlan's idea, see
;;; http://stackoverflow.com/questions/3078811#3080868
(defn prime-Powers-LCM [m]
(zipmap (primes m)
(map (fn [p]
(->> (range)
(drop-while #(<= (expt p %) m))
first
dec))
(primes m))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment