In
mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
, the Legendre sieve, named after
Adrien-Marie Legendre
Adrien-Marie Legendre (; ; 18 September 1752 – 9 January 1833) was a French mathematician who made numerous contributions to mathematics. Well-known and important concepts such as the Legendre polynomials and Legendre transformation are named ...
, is the simplest method in modern
sieve theory
Sieve theory is a set of general techniques in number theory, designed to count, or more realistically to estimate the size of, sifted sets of integers. The prototypical example of a sifted set is the set of prime numbers up to some prescribed lim ...
. It applies the concept of the
Sieve of Eratosthenes
In mathematics, the sieve of Eratosthenes is an 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 n ...
to find upper or lower
bound
Bound or bounds may refer to:
Mathematics
* Bound variable
* Upper and lower bounds, observed limits of mathematical functions
Physics
* Bound state, a particle that has a tendency to remain localized in one or more regions of space
Geography
*B ...
s on the number of
prime
A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only ways ...
s within a given set of integers. Because it is a simple extension of
Eratosthenes
Eratosthenes of Cyrene (; grc-gre, Ἐρατοσθένης ; – ) was a Greek polymath: a mathematician, geographer, poet, astronomer, and music theorist. He was a man of learning, becoming the chief librarian at the Library of Alexandria ...
' idea, it is sometimes called the Legendre–Eratosthenes sieve.
[Iwaniec, Henryk]
The sieve of Eratosthenes–Legendre
Annali della Scuola Normale Superiore di Pisa – Classe di Scienze, Sér. 4, 4 no. 2 (1977), pp. 257–268 M
453676
!-- Bot generated title -->
Legendre's identity
The central idea of the method is expressed by the following identity, sometimes called the Legendre identity:
:
where ''A'' is a set of integers, ''P'' is a product of distinct primes,
is the
Möbius function
The Möbius function is a multiplicative function in number theory introduced by the German mathematician August Ferdinand Möbius (also transliterated ''Moebius'') in 1832. It is ubiquitous in elementary and analytic number theory and most oft ...
, and
is the set of integers in ''A'' divisible by ''d'', and ''S(A, P)'' is defined to be:
:
i.e. ''S''(''A'', ''P'') is the count of numbers in ''A'' with no factors common with ''P''.
Note that in the most typical case, ''A'' is all integers less than or equal to some real number ''X'', ''P'' is the product of all primes less than or equal to some integer ''z'' < ''X'', and then the Legendre identity becomes:
:
(where
denotes the
floor function
In mathematics and computer science, the floor function is the function that takes as input a real number , and gives as output the greatest integer less than or equal to , denoted or . Similarly, the ceiling function maps to the least int ...
). In this example the fact that the Legendre identity is derived from the Sieve of Eratosthenes is clear: the first term is the number of integers below ''X'', the second term removes the multiples of all primes, the third term adds back the multiples of two primes (which were miscounted by being "crossed out twice") but also adds back the multiples of three primes once too many, and so on until all
(where
denotes the number of primes below ''z'') combinations of primes have been covered.
Once ''S''(''A'', ''P'') has been calculated for this special case, it can be used to bound
using the expression
:
which follows immediately from the definition of ''S''(''A'', ''P'').
Limitations
The Legendre sieve has a problem with fractional parts of terms accumulating into a large error, which means the sieve only gives very weak bounds in most cases. For this reason it is almost never used in practice, having been superseded by other techniques such as the
Brun sieve In the field of number theory, the Brun sieve (also called Brun's pure sieve) is a technique for estimating the size of "sifted sets" of positive integers which satisfy a set of conditions which are expressed by congruences. It was developed by Vi ...
and
Selberg sieve
In number theory, the Selberg sieve is a technique for estimating the size of "sifted sets" of positive integers which satisfy a set of conditions which are expressed by congruences. It was developed by Atle Selberg in the 1940s.
Description
In ...
. However, since these more powerful sieves are extensions of the basic ideas of the Legendre sieve, it is useful to first understand how this sieve works.
References
{{DEFAULTSORT:Legendre Sieve
Sieve theory