By the same authors

From the same journal

FUNCTIONAL PEARL : lazy wheel sieves and spirals of primes

Research output: Contribution to journalArticle

Full text download(s)

Links

Published copy (DOI)

Author(s)

Department/unit(s)

Publication details

JournalJournal of Functional Programming
DatePublished - Mar 1997
Issue number2
Volume7
Number of pages6
Pages (from-to)219-225
Original languageEnglish

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.

Bibliographical note

© 1997 Cambridge University Press. Reproduced in accordance with the publisher's self-archiving policy.

Discover related content

Find related publications, people, projects, datasets and more using interactive charts.

View graph of relations