Verified Commit 6ac91086 authored by Thimo Neumann's avatar Thimo Neumann
Browse files

Add explanation for sieve of eratosthenes

parent 4d294fe2
# Own:
*.exe
.idea
# From https://raw.githubusercontent.com/github/gitignore/master/Haskell.gitignore
dist
......
import SieveOfEratosthenes
main = putStrLn (show (take 10 (primes) ) )
main = putStrLn ("First 9 prime numbers: " ++ (show (take 9 (primes) ) ) )
# The Sieve of Eratosthenes
1. Write down the successive "plurals": 2, 3, 4, ...
2. Repeat:
1. Take the first number that is not circled or crossed out.
2. Circle it.
3. Cross out its proper multiples.
3. What is left (i.e. the circled numbers) are the successive prime numbers.
**Example**
```
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 ...
(2) 3 x 5 x 7 x 9 xx 11 xx 13 xx 15 xx 17 xx 19 xx 21 xx 23 xx 25 ...
(2) (3) 5 7 x 11 13 xx 17 19 xx 23 25 ...
(2) (3) (5) 7 11 13 17 19 23 xx ...
...
```
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment