a guest Oct 29th, 2010 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- (defn prime? [n]
- (let [q (int (Math/sqrt n))]
- (not-any? #(zero? %) (map #(rem n %) (range 2 (inc q))))))
- (reduce + (take-while #(< % 2000000) (filter prime? (iterate inc 2))))
RAW Paste Data