FUNCTIONAL PEARL Calculating the Sieve of Eratosthenes
Autor: | Lambert Meertens |
---|---|
Rok vydání: | 2004 |
Předmět: | |
Zdroj: | Journal of Functional Programming. 14:759-763 |
ISSN: | 1469-7653 0956-7968 |
DOI: | 10.1017/s0956796804005210 |
Popis: | The Sieve of Eratosthenes is an efficient algorithm for computing the successive primes. Rendered informally, it is as follows:1. Write down the successive “plurals”: 2, 3, 4, …2. Repeat:(a) Take the first number that is not circled or crossed out.(b) Circle it.(c) Cross out its proper multiples.3. What is left (i.e. the circled numbers) are the successive prime numbers. |
Databáze: | OpenAIRE |
Externí odkaz: |