Hi,

this is a “hold unto head” problem.

Am 17.11.2011 um 15:06 schrieb Julian Kelsey:

>   (def seq-3s-n-5s 
>     (filter 
>       (fn [n] (or (= 0 (mod n 5)) (= 0 (mod n 3)) ) ) 
>       (iterate inc 1)))

Here you keep a reference to the head of the generated by iterate. Make it a 
function:

(defn seq-3s-n-5s
  []
  (filter #(or (zero? (mod % 5)) (zero? (mod % 3))) (iterate inc 1)))

Then call it like this:

(nth (sums (seq-3s-n-5s 0) (Math/pow 10 6))

That should fix your problem.

Sincerely
Meikel

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to