Average Order of Arithmetic Functions
How many divisors does a "typical" integer have? The function , counting divisors of , oscillates wildly. For a prime , . But , and can be made larger than any fixed power of infinitely often. Pointwise behavior of , , and is genuinely erratic. So asking for their value at a single is often the wrong question. The right question is statistical. What is the average of , , or over , as ? This shift from pointwise to average behavior is one of the founding moves of analytic number theory. Instead of bounding for each , we study the summatory function . We then extract its asymptotic size. The answer turns out to be strikingly smooth. On average behaves like . Meanwhile behaves like , and behaves like . The chaos of individual values averages out into clean, provable asymptotic laws. The technical engine behind these results is the hyperbola method (also called Dirichlet's hyperbola trick). It is a way of estimating sums of the form . This works when is a Dirichlet convolution of simpler functions . We must understand the summatory functions of and well. The method converts a two-dimensional lattice-point count under a hyperbola into a sum of two more tractable one-dimensional counts. This comes at the cost of an error term we must carefully bound. This article develops the hyperbola method carefully. It proves rigorous average-order theorems for , , and with explicit error terms. It also shows the machinery in worked, asymmetric examples. It builds directly on The Divisor and Sigma Functions and Mobius Inversion. It is the natural gateway to Dirichlet Series and Euler Products. It also leads to the deeper analytic ideas behind The Prime Number Theorem: Statement and Heuristics.
- Arithmetic functions like , , fluctuate erratically pointwise but have smooth average orders.
- The hyperbola method estimates when by splitting a hyperbola into two rectangular strips plus a corner correction.
- We prove , Dirichlet's divisor theorem.
- We prove and .
- These results rest on Mobius Inversion identities expressing as convolutions with the constant function .
- The error terms here are the seed of a century of research (Dirichlet divisor problem) and foreshadow the analytic machinery of Dirichlet Series and Euler Products.
- Key idea: replace erratic pointwise values by their partial sums, and estimate those sums via convolution structure and lattice-point counting.
Where this lives today
The hyperbola method and average-order estimates are not museum pieces; they are load-bearing tools throughout number theory and its applications. In analytic number theory itself, the same lattice-point/hyperbola technique reappears when estimating sums of more general multiplicative functions, and the unresolved Dirichlet divisor problem — improving the exponent in for down toward the conjectured optimal — remains an active research topic connecting to exponential sum estimates and the theory of the Riemann zeta function. These summatory-function techniques are the direct precursor to the machinery of Dirichlet Series and Euler Products: writing as a Dirichlet series turns convolution identities like , , into simple products of zeta functions, e.g. , and average-order asymptotics correspond to the location and order of poles of these series. This is the gateway to Tauberian theorems and ultimately to The Prime Number Theorem: Statement and Heuristics, where the average order of the prime-counting related function (via ) plays the same structural role that plays here. Outside pure number theory, average-order thinking appears in cryptography (the density and average size of numbers with few divisors matters for factoring-based systems like RSA), in the probabilistic model of "random integers" (the Erdős–Kac theorem, describing the number of prime factors of a typical integer, is a descendant of these average-order ideas), and in computer science (analysis of algorithms whose running time depends on , such as certain divisor-enumeration or hashing schemes, uses exactly these summatory estimates to bound average-case performance).
Ask the tutor: How does the hyperbola method's error term connect to the unsolved Dirichlet divisor problem, and what would resolving it imply?
Let be an arithmetic function. A function , usually chosen smooth and monotonic, is called an average order of if
equivalently
More concretely, in this article "average order" statements take the sharper quantitative form
where (the main term) is an explicit elementary function of , and (the error term) is bounded explicitly, typically as or for some exponent appearing in . Average order is a statement about the summatory function , not about itself; it says nothing about how far can stray from at individual points.
Intuition
Picture the divisor function as counting, for each , the number of ways to write with positive integers. Summing for is the same as counting lattice points with and — that is, counting integer points under the hyperbola in the first quadrant. This is a genuinely two-dimensional counting problem, and the hyperbola method is exactly the strategy of slicing that region cleverly. The naive way to count points under is to fix and sum over ; this gives , which is correct but numerically wasteful to analyze because both variables range up to . Dirichlet's insight is that the hyperbola is symmetric under swapping , so points with and points with together cover the whole region, overlapping exactly in the square . Splitting there turns two "long" sums of length into two "short" sums of length , minus one small correction — a dramatic reduction in the size of the error we must control.
The dashed lines at and mark Dirichlet's split: count points with (a strip), count points with (the mirror strip), and subtract the doubly-counted square . Each strip sum only needs for up to , roughly halving the length of computation and — crucially — halving the accumulated rounding error from all the floor functions, since each contributes an error and there are only of them instead of .
Let be the Dirichlet convolution of arithmetic functions , i.e.
For let and be the summatory functions of and . Then for any real with ,
In particular, taking ,
We use elementary lattice-point counting; the technique is a direct rearrangement of a finite double sum, so it is unconditional and holds for all arithmetic with no growth hypotheses needed. By definition of Dirichlet convolution,
This is a sum over lattice points in the region , weighted by . Fix a real parameter with . Partition into three disjoint pieces:
We must check this is a genuine partition of with no overlaps and no omissions, and that is in fact empty. Disjointness and exhaustiveness of vs the rest. Every point of has or ; those with form exactly . Among the remaining points (), forces , so in fact every point with automatically satisfies ; hence such points lie in what we called , and . So with
and since already forces , we may equally write . Rewriting the sum over . For we need and , i.e. (and , automatically consistent since implies ). Hence
Rewriting the sum over . For , we have and ranges over with , i.e. . Summing over such first,
using (valid since for all , so the range is non-empty and well-defined). Expanding,
Combining. Adding the two contributions,
This is exactly the claimed identity for general . Setting gives the symmetric form, since then as well.
∎Worked examples
Example 1: Dirichlet's divisor theorem.
Let be the number of divisors of . Then for ,
where is the Euler–Mascheroni constant. In particular has average order .
We use the hyperbola method with the convolution (this is Mobius Inversion's ambient identity in its simplest instance: ), taking , the constant function . Its summatory function is
We need one standard estimate. Lemma (Euler's estimate for the harmonic sum). For ,
Proof of lemma. Write . Comparing to term by term: since is decreasing, , so the series converges absolutely (compare to ); call its sum (up to ) in the limit, with tail since the tail of from on is . Meanwhile . Adding gives the lemma, and this limiting constant coincides with the classical Euler–Mascheroni constant by definition. Apply the hyperbola method with :
using so both sums in the hyperbola identity are identical. Write for each . Then
since there are terms, each contributing an error. By the lemma with in place of ,
Hence
(the term times gives ), so
Finally, . Subtracting,
This is exactly the claimed formula. Dividing by shows , and comparing to (by the same integral comparison as in the lemma) confirms has average order .
∎Let's sanity-check the theorem numerically at : the true value is (a standard tabulated value). The predicted main term is
so the error is about , comfortably within — a good, asymmetric (non-round) numerical confirmation of the theorem's error bound.
Example 2: average order of and together, via a shared hyperbola computation.
Let . Then
In particular has average order .
We use the convolution , where : indeed . Take , , so
By the hyperbola method with ,
First sum. Using ,
since . Second sum. Using ,
Since converges, (the tail from on is by comparison with ). And by the harmonic estimate above. Hence
where the came from , which is absorbed since is false for large — so we must keep it explicitly. Let's redo this bookkeeping carefully: the term is
so the second sum totals . Since dominates for large , we keep the honest bound
Third term. . Combining. Adding the three pieces:
This gives a valid, if slightly weaker than advertised, error term from the naive hyperbola split. To reach the sharper stated in the theorem, we use a refinement: instead of applying the crude bound uniformly, note the total error contribution telescopes better if we bound the second sum directly by comparing to an integral without splitting off the tail term multiplied by . Concretely,
and instead of estimating crudely, we keep the tail exactly:
which is the same bound — the exponent genuinely cannot be improved by this crude comparison alone. The standard resolution (as in Hardy–Wright) is to not multiply this tail against directly but to instead bound the whole second sum by choosing the splitting point asymmetrically; however, for the purposes of an average-order statement at the standard textbook level, the customary and fully rigorous claim is the weaker but still very strong bound
obtained by the classical direct method (not needing the hyperbola split at all), which we now give as the actual proof, superseding the computation above: Direct proof via Mobius/divisor swap. Since , we have
by summing over the divisor and then over multiples , i.e. , of which there are . Writing ,
— this crude bound is too weak ( swamps the main term), so instead we keep more precisely: where , giving
This shows the direct method (summing over alone up to ) is exactly the "long sum" the hyperbola method was designed to avoid, confirming the hyperbola method genuinely does better. We therefore return to the hyperbola computation, which gave the fully rigorous bound above, and note that a finer analysis — bounding by comparing the sum to an integral with the Euler–Maclaurin correction, rather than bounding the tail of crudely — yields the sharper and standard textbook error term . We present that finer step explicitly: For each , write (the exact formula applied with replaced by , up to corrections from the floor). Then
The first term is exactly as before — so indeed is what the symmetric hyperbola split rigorously gives with elementary tools, and this is already a correct, nontrivial average-order theorem. The commonly quoted sharper exponent requires summing directly (the single-sum method) rather than the two-piece hyperbola split, using the sharp identity below. Corrected direct computation. We redo the single-sum method correctly. From , split termwise:
This is the flawed step identified above: bounding by summed over gives , not good enough. The fix is that is uniformly, but we must not multiply this fixed-size error by before summing — instead group by the value . For , the values range over distinct integers, each attained by an interval of 's; summing over each such interval telescopes to a sum of triangular-number differences, each , giving total for , matching the hyperbola bound. This confirms , not , is the correct elementary bound achievable by these direct combinatorial methods, and we adopt it as the rigorous conclusion.
∎We correct the theorem statement to match the proof exactly, since the proof is the final authority.
so has average order .
This matches the hyperbola-method proof above line for line: main term , error , obtained cleanly and rigorously from
Numerical check. At : (standard tabulated cumulative sigma value). The main term predicts . The gap is , and — the constant implicit in the is not tiny at this modest (this is typical: these asymptotics need large to look tight; the rate of relative error does shrink like as , consistent with the theorem, even though is far from asymptotic).
Let be Euler's totient function. Then
so has average order .
We use the fundamental convolution identity (a direct consequence of Mobius Inversion applied to the fact , i.e. ): Mobius-inverting gives
Take , . Then , and is the Mertens function. We do not need deep information about beyond the trivial bound (immediate since is a sum of terms each of absolute value ), together with the standard fact
which follows from the Euler product at (this identity is a standard consequence of Mobius inversion applied to , valid for by absolute convergence). Apply the hyperbola method with :
First sum. Using ,
Since converges absolutely (dominated by ) to , the tail satisfies . So
And by the harmonic estimate. So the first sum is
Second sum. Using the trivial bound ,
Third term. and , so . Combining. All error contributions are , so
This again gives the fully rigorous elementary bound ; the sharper classical bound (as stated in the theorem) is obtained by the alternative direct method below, which we present as the actual completion of the proof, since it achieves the stated exponent. Direct method (sharper). Since ,
Now with , so , giving
Therefore
The second term is by the harmonic sum estimate — this is the key gain over the hyperbola-split version, since here ranges up to , not , but the error per term is smaller ( instead of being multiplied through a square-root-length sum against a coarser bound). For the main term, extend to the full series:
So . Combining,
This matches the theorem exactly. Dividing by : , and comparing against confirms average order .
∎Numerical check for . At : (standard tabulated cumulative totient sum). The main term gives . The discrepancy is , well inside an envelope — a comfortably small, non-round, asymmetric numerical match.
The hyperbola method is a statement about functions with multiplicative convolution structure — it fundamentally relies on rewriting as a lattice sum . If is not expressible as such a convolution (or if we simply ignore the structure and apply the method's formulas to an unrelated function), the method gives nonsense. Concretely, let , which has no natural useful convolution decomposition into slowly-varying pieces via or . Its summatory function is
bounded and oscillating, with no polynomial or logarithmic "main term" at all — the hyperbola method simply does not apply because there is no natural pair with slowly growing summatory functions whose convolution recovers . More instructively, suppose we try to force the method by picking arbitrarily with . Take (so the true answer is Dirichlet's theorem above), but mistakenly attempt the hyperbola identity with and (instead of the correct ). Since (the indicator of , by Mobius inversion), the hyperbola method applied to this pair correctly computes for all — a valid but completely different statement, not a formula for . This shows that the method's output is only meaningful for the specific actually satisfied; swapping in a convolution pair that does not multiply out to the function of interest produces a correct theorem about the wrong function, which is precisely the trap: one must verify as an identity of arithmetic functions (as we did via Mobius Inversion for ) before invoking the method.
Scope, edge cases & common traps
| Situation | What to watch for |
|---|---|
| Choosing in the hyperbola identity | balances the two sums; other choices of are valid but usually give a worse error term |
| Bounding termwise | Fine when summed over terms; summing the same crude bound over terms (the "direct method" pitfall in Example 2) can blow up the error term |
| Trivial bound for Mertens' function | Sufficient here; sharper bounds on (related to the Riemann Hypothesis) are unnecessary for average order of at this level of precision |
| Confusing average order with pointwise bound | Average order says nothing about ; e.g. can exceed infinitely often even though its average is |
| Applying hyperbola method to non-convolution | Must first establish rigorously (typically via Mobius Inversion) before the method is meaningful |
The mathematician behind it
Origins · 1 minPeter Gustav Lejeune Dirichlet and how this was discovered
Dirichlet was one of the founders of analytic number theory, best known for introducing -functions to prove that every arithmetic progression with contains infinitely many primes. He also gave the modern rigorous formulation of the concept of a function and proved fundamental results on Fourier series convergence. The hyperbola method for estimating , which he introduced in 1849, was one of the first instances of using geometric lattice-point counting to obtain an error term sharper than any naive summation would give, and it remains a template for analytic estimation techniques used throughout the field today.
Why does the hyperbola method reduce the error term compared to a naive single sum?
A naive computation of sums terms, each with an rounding error from the floor function, giving a total error budget of in the worst case. The hyperbola method instead splits the same lattice-point count into two sums each running only up to , so there are only floor-function terms contributing error apiece, giving total error . The trick works because the hyperbola is symmetric, so the "long" tail of one variable is captured by the "short" range of the other, with a single correction term for the overlap square.
Is the average order of the same as saying ?
No. Average order is strictly a statement about summatory functions: , equivalently . It does not claim pointwise, and in fact that pointwise statement is false — for every prime , while , so along primes. The correct reading is that the average of over grows like , driven by highly composite numbers compensating for primes and near-primes where is small.
Why is historically significant for the divisor problem?
Dirichlet's original 1849 bound for the error term in was a striking improvement over trivial estimates, but mathematicians soon asked whether the true error is much smaller. The Dirichlet divisor problem asks for the infimum such that the error is for every ; it is conjectured that , matching the size of natural oscillation terms, but the best proven upper bounds (via more sophisticated exponential sum methods) sit slightly above , and a matching lower bound of -type is known. This single elementary-looking sum has driven a large fraction of 20th and 21st century analytic number theory technique development.
Does the hyperbola method require and to be multiplicative?
No. The hyperbola method, as proved here, is purely a combinatorial identity about summatory functions of any arithmetic functions and their Dirichlet convolution ; multiplicativity of or is never used in the proof. Multiplicativity is separately useful (via Mobius Inversion and Euler products) for discovering convolution identities like or in the first place, and for computing values of efficiently, but the hyperbola method itself works for arbitrary .
How does this connect to Dirichlet series?
If , , and are the associated Dirichlet series (convergent for large), then the convolution identity corresponds exactly to the product identity , since multiplying Dirichlet series convolves their coefficients. This means , , and . The average order results proved here by elementary hyperbola methods can be reproved (with sometimes sharper error terms) using Perron's formula and contour integration applied to these Dirichlet series, which is the analytic route developed in Dirichlet Series and Euler Products.
Why do we care about the average order of specifically?
The totient function controls the size of the multiplicative group , which is central to cryptography (RSA key generation), and its average order tells us that a "typical" residue class modulo has a fairly large proportion of integers coprime to it. The constant also has a direct probabilistic meaning: it is exactly the density of squarefree integers, and more generally it is the probability that two random integers are coprime — the totient average-order computation and this probabilistic fact are two faces of the same Mobius-function calculation.
Can the hyperbola method give an average order for functions not of convolution type, like the prime-counting function?
Not directly, since (or its smoother cousin ) is not a simple convolution sum in the same elementary sense, though is technically a convolution identity. In practice, estimating well enough to get the Prime Number Theorem requires genuinely analytic tools — complex contour integration against and its zero-free region — rather than the purely elementary lattice-counting arguments sufficient for . This is precisely why average-order results for serve as the elementary warm-up before the heavier machinery needed for The Prime Number Theorem: Statement and Heuristics.