Skip to content

pcerman/esieve-clojure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Lazy sequence of the prime numbers in clojure

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published