The Selberg upper-bound sieve replaces an exact but long inclusion-exclusion expansion by a short nonnegative square, and then minimizes its main term. For an interval , the count of multiples of every integer is
Crucially the remainder bound is independent of .
Let and take real weights , supported on squarefree , with . If , the sum of these weights over divisors of is just one; for all other its square is nonnegative. Thus
Expanding and counting common multiples gives
This separates the local density from a uniform interval error. The weights will be chosen to minimize .
The Euler totient function identity yields the Selberg sieve diagonalization
Only squarefree occur. Inverting this finite triangular sum by Möbius inversion gives
Write . The Cauchy-Schwarz inequality gives , with equality at . The inverse formula then produces the optimal Selberg sieve weights
The constraints are satisfied, since the diagonal transformation is invertible and .
We need the leading constant, not just . Here is an elementary proof of the Selberg sieve denominator asymptotic. For define the multiplicative arithmetic function by
Checking the prime-local factors shows . Also : the local factors for absolute values differ from one by , and their logarithmic first moments sum . The signed local sums are all one, so absolute convergence gives . Using the harmonic number estimate,
For the last equality, is bounded and is bounded too.
The optimal Selberg weights have modulus at most one. To prove this here, for squarefree use . The product is the sum of over , , , with squarefree. All are distinct squarefree integers at most , and so these are a subset of the terms of . The displayed weight formula now gives . Consequently
Every prime in the interval exceeding survives the sieve; at most smaller primes must be restored. Choose . Then
and the uniform interval bound from optimal Selberg weights follows:
All constants are independent of . Given , make the absolute error in the coefficient smaller than by choosing large enough. Uniformly for every and ,
For all interval origins , the number of multiples of any in is with an absolute error bound. The Selberg sieve diagonalization minimizes , subject to , at . The optimal Selberg weights have modulus at most one, so the total remainder is . Restoring the at most small primes gives . Take and use the Selberg sieve denominator asymptotic. The resulting is independent of .