Hi,

On Jan 27, 2:43 pm, "twitter.com/nfma" <nuno.filipe.marq...@gmail.com>
wrote:

> hmm... I'm just learning clojure at the moment but by looking at code what I
> see is:
>
> 1 - A collecting parameter called primes
> 2 - A test to verify if a number is a prime by calculating the reminder of
> the division with all (or some) of the primes already found
> 3 - if a number is a prime then its added to the primes list
>
> if the above is true then this is not the sieve of Eratosthenes...
>
> at least according to 
> wikipedia:http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes

The above is true and still it is the sieve of Eratosthenes. Just in a
different form. For the sieve you have to walk for each prime found
the remaining numbers and test to verify if a number is not a prime by
calculating the reminder of the division with the current prime. Then
you skip to the next unmarked number, which is again prime. We do just
one walk and check against the accumulated prime list as we go. This
does in the end exactly the same.

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