White Rose University Consortium logo
University of Leeds logo University of Sheffield logo York University logo

FUNCTIONAL PEARL : lazy wheel sieves and spirals of primes

Runciman, C. (1997) FUNCTIONAL PEARL : lazy wheel sieves and spirals of primes. Journal of Functional Programming. pp. 219-225. ISSN 1469-7653

Full text available as:
[img]
Preview
Text (runcimanc1.pdf)
runcimanc1.pdf

Download (120Kb)

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.

Item Type: Article
Copyright, Publisher and Additional Information: © 1997 Cambridge University Press. Reproduced in accordance with the publisher's self-archiving policy.
Institution: The University of York
Academic Units: The University of York > Computer Science (York)
Depositing User: Repository Officer
Date Deposited: 19 May 2008 11:35
Last Modified: 15 Oct 2014 02:40
Published Version: http://dx.doi.org/10.1017/S0956796897002670
Status: Published
Refereed: Yes
Related URLs:
URI: http://eprints.whiterose.ac.uk/id/eprint/3784

Actions (repository staff only: login required)