Skip to main content
Article thumbnail
Location of Repository

FUNCTIONAL PEARL : lazy wheel sieves and spirals of primes

By C. Runciman

Abstract

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

Year: 1997
DOI identifier: 10.1017/S0956796897002670
OAI identifier: oai:eprints.whiterose.ac.uk:3784

Suggested articles


To submit an update or takedown request for this paper, please submit an Update/Correction/Removal Request.