In this video we'll cover, first the history and basics of the Sieve of Eratosthenes, later we'll open up a coding editor and implement the algorithm using the Python coding language. At the end we compare the computational efficiency against other prime number sieves.
If you'd like to learn about Python data structures, check out my video series starting with: • Python Data Structures...
Video series covering GUI development in Python: • Python GUI Development...
References:
[1] - en.wikipedia.org/wiki/Eratost...
[2] - en.wikipedia.org/wiki/Sieve_o...
[3] - en.wikipedia.org/wiki/Destruc...
In mathematics, the sieve of Eratosthenes is a simple, ancient algorithm for finding all prime numbers up to any given limit.
It does so by iteratively marking as composite (i.e., not prime) the multiples of each prime, starting with the first prime number, 2. The multiples of a given prime are generated as a sequence of numbers starting from that prime, with constant difference between them that is equal to that prime. This is the sieve's key distinction from using trial division to sequentially test each candidate number for divisibility by each prime.
The earliest known reference to the sieve (Ancient Greek: κόσκινον Ἐρατοσθένους, kóskinon Eratosthénous) is in Nicomachus of Gerasa's Introduction to Arithmetic, which describes it and attributes it to Eratosthenes of Cyrene, a Greek mathematician.
One of a number of prime number sieves, it is one of the most efficient ways to find all of the smaller primes. It may be used to find primes in arithmetic progressions.
10 авг 2024