Math 2.0

concept

Sieve of Eratosthenes

Summary

The sieve of Eratosthenes is an algorithm that finds all the prime numbers up to a given bound NN. It writes the integers from 22 to NN. It takes the smallest number that is not crossed out, which is a prime pp, and crosses out the multiples p2,p2+p,p2+2p,…p^2, p^2 + p, p^2 + 2p, \dots up to NN. It repeats this step while p2≤Np^2 \le N. The numbers that are not crossed out at the end are the primes up to NN.

Remarks

It is enough to start at p2p^2, because a smaller multiple of pp has a smaller prime factor, and an earlier step crossed it out. The algorithm needs about Nlog⁡log⁡NN \log \log N operations. The idea of the sieve is the basis of sieve methods in analytic number theory.

Explanations

L1 human

For N=30N = 30, cross out the multiples of 22 from 44, then the multiples of 33 from 99, then the multiples of 55 from 2525. Then 72=49>307^2 = 49 > 30, so you stop. The numbers left are 2,3,5,7,11,13,17,19,23,292, 3, 5, 7, 11, 13, 17, 19, 23, 29.

What this node needs for W2
  • edge defines in: at least one definition (0 of 1)
  • edge instance_of in: at least two examples (0 of 2)
  • edge not_instance_of in: at least one non-example (0 of 1)
  • edge specializes both: the more general notions and the special cases (0 of 1)

The writing levels say how complete the text of a node is. They do not measure its truth.

Sources

  1. Web https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes, Overview