• Media type: E-Article
  • Title: FUNCTIONAL PEARL Lazy wheel sieves and spirals of primes
  • Contributor: RUNCIMAN, COLIN
  • Published: Cambridge University Press (CUP), 1997
  • Published in: Journal of Functional Programming, 7 (1997) 2, Seite 219-225
  • Language: English
  • DOI: 10.1017/s0956796897002670
  • ISSN: 0956-7968; 1469-7653
  • Keywords: Software
  • Origination:
  • Footnote:
  • Description: 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.
  • Access State: Open Access