Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 785 Bytes

README.md

File metadata and controls

30 lines (21 loc) · 785 Bytes

Sieve of Eratosthenes (esieve-clojure)

This is experimental implementation of the Sieve of Eratosthenes in functional style in clojure programming language. I was inspired by the paper [1].

License

This code is released under MIT License.

Copyright (c) 2016 Peter Cerman (https://github.com/pcerman)

Example of use

(load-file "esieve.clj")

;; Take 100 first prime numbers.
(take 100 primes)

;; alternatively, but prime numbers are computed again and advantage of lazy
;; sequence is not exploited.
(take 100 (esieve))

References

  1. O'Neill, Melissa E., "The Genuine Sieve of Eratosthenes", Journal of Functional Programming, Published online by Cambridge University Press 09 Oct 2008 doi:10.1017/S0956796808007004.