Let σ0(n) be the divisor-counting function, and let D(n) be its summatory function:
Computing D(n) naïvely requires factoring every integer in the interval [1, n]; an improvement can be made by using a modified Sieve of Eratosthenes, but this still requires Õ(n) time. Since σ0 admits the Dirichlet convolution σ0 = 1 ∗ 1, taking a = b = √n in (1) yields the formula
which simplifies to
which can be evaluated in O(√n) operations.
The method also has theoretical applications: for example, Peter Gustav Lejeune Dirichlet introduced the technique in 1849 to obtain the estimate12
where γ is the Euler–Mascheroni constant.
Dirichlet, Peter Gustav Lejeune (1849). "Über die Bestimmung der mittleren Werthe in der Zahlentheorie". Abhandlungen der Königlich Preussischen Akademie der Wissenchaften (in German): 49–66 – via Gallica. /wiki/Peter_Gustav_Lejeune_Dirichlet ↩
Tenenbaum, Gérald (2015-07-16). Introduction to Analytic and Probabilistic Number Theory. American Mathematical Soc. p. 44. ISBN 9780821898543. 9780821898543 ↩