algorithms:sieve:eratosthenes
Differences
This shows you the differences between two versions of the page.
Both sides previous revision
Previous revision
Next revision
|
Previous revision
|
algorithms:sieve:eratosthenes [2018/08/10 18:57] jguerin Added link to Goldbach's, happy problems. |
algorithms:sieve:eratosthenes [2018/08/20 13:58] (current) jguerin Minor wording tweak. |
====== Prime Number Generator: Sieve of Eratosthenes ====== | ====== Prime Number Generator: Sieve of Eratosthenes ====== |
| |
Prime sieves are common devices for generating prime numbers in a given range. These lists can be used for quick verification of relatively small prime numbers (typically ranging up to 10<sup>6</sup> or greater), in particular when many such verifications may be necessary. | Prime sieves((A sieve (Pronounced like "give" not "sleeve".) is a physical metaphor (i.e., a mesh bowl in a kitchen) for an algorithmic technique used in number theory to "sift out" a class of numbers in a given set or range.)) are common devices for generating prime numbers in a given range. These lists can be used for quick verification of relatively small prime numbers (typically no larger than 10<sup>8</sup>) when many such verifications may be necessary. |
| |
== Etymology == | |
A sieve((Pronounced like "give" not "sleeve".)) is a physical metaphor (i.e., a mesh bowl in a kitchen) for an algorithmic technique used in number theory to "sift out" a class of numbers in a given set or range. | |
| |
===== Source ===== | ===== Source ===== |
</file> | </file> |
| |
=== Implementation Notes === | ==== Implementation Notes ==== |
A C++ [[cpp_std_bitset|bitset]](([[http://www.cplusplus.com/reference/bitset/bitset/]])) is used for additional time/space efficiency to store true/false values. A [[cpp_std_vector|vector]] would also work, but at an increased cost of time and space. | A C++ [[cpp_std_bitset|bitset]](([[http://www.cplusplus.com/reference/bitset/bitset/]])) is used for additional time/space efficiency to store true/false values. A [[cpp_std_vector|vector]] would also work, but at an increased cost of time and space. |
| |
algorithms/sieve/eratosthenes.1533945432.txt.gz ยท Last modified: 2018/08/10 18:57 by jguerin