Article contents
FUNCTIONAL PEARL Lazy wheel sieves and spirals of primes
Published online by Cambridge University Press: 01 March 1997
Abstract
Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.
The popular method of enumerating the primes is the Sieve of Eratosthenes. It can be programmed very neatly in a lazy functional language, but runs rather slowly. A little-known alternative method is the Wheel Sieve, originally formulated as a fast imperative algorithm for obtaining all primes up to a given limit, assuming destructive access to a bit-array. This article describes functional variants of the wheel sieve that enumerate all primes as a lazy list.
- Type
- Research Article
- Information
- Copyright
- © 1997 Cambridge University Press
You have
Access
- 1
- Cited by
Discussions
No Discussions have been published for this article.