Academy
MathsNumber TheoryDirichletDirichlet's Divisor Problem

Dirichlet's Divisor Problem

How does the sum of all divisor counts up to n grow? Dirichlet's answer — n log n with a precise error — is 175 years old. The sharp error bound is still open.

How large is τ(1)+τ(2)++τ(n)\tau(1) + \tau(2) + \cdots + \tau(n)?

Individual divisor counts τ(k)\tau(k) jump erratically — τ(p)=2\tau(p) = 2 for primes, τ(12)=6\tau(12) = 6, τ(1024)=11\tau(1024) = 11. There is no clean formula for τ(k)\tau(k).

But the sum is smooth. Averaging washes out the fluctuations. Dirichlet found the precise asymptotic in 1849, and it is one of the most beautiful results in elementary analytic number theory.


The main theorem

Theorem (Dirichlet, 1849). Let D(n)=k=1nτ(k)D(n) = \displaystyle\sum_{k=1}^{n} \tau(k). Then:

D(n)=nlnn+(2γ1)n+O(n)D(n) = n\ln n + (2\gamma - 1)n + O(\sqrt{n})

where γ0.5772\gamma \approx 0.5772\ldots is the Euler-Mascheroni constant.

Equivalently: the average number of divisors of integers up to nn is lnn+(2γ1)+O(1/n)\ln n + (2\gamma - 1) + O(1/\sqrt{n}).


The proof — two steps

Step 1: Lattice point reformulation

From Counting Lattice Points:

D(n)=k=1nτ(k)=#{(a,b)Z2:a,b1, abn}D(n) = \sum_{k=1}^{n}\tau(k) = \#\{(a,b) \in \mathbb{Z}^2 : a,b \geq 1,\ ab \leq n\}

Each pair (a,b)(a,b) with abnab \leq n corresponds to a divisor aa of some k=abnk = ab \leq n.

Step 2: Count using symmetry

Let m=nm = \lfloor\sqrt{n}\rfloor. Split the region abnab \leq n by the diagonal a=ba = b:

D(n)=2a=1mnam2D(n) = 2\sum_{a=1}^{m}\left\lfloor\frac{n}{a}\right\rfloor - m^2

Now approximate n/an/a\lfloor n/a \rfloor \approx n/a:

a=1mna=na=1m1aa=1m{na}\sum_{a=1}^{m}\left\lfloor\frac{n}{a}\right\rfloor = n\sum_{a=1}^{m}\frac{1}{a} - \sum_{a=1}^{m}\left\{\frac{n}{a}\right\}

where {x}\{x\} is the fractional part. The second sum is O(m)=O(n)O(m) = O(\sqrt{n}) since each term is in [0,1)[0,1).

Using Hm=lnm+γ+O(1/m)H_m = \ln m + \gamma + O(1/m) and m=n+O(1)m = \sqrt{n} + O(1):

a=1m1a=lnn+γ+O(1/n)=12lnn+γ+O(1/n)\sum_{a=1}^{m}\frac{1}{a} = \ln\sqrt{n} + \gamma + O(1/\sqrt{n}) = \frac{1}{2}\ln n + \gamma + O(1/\sqrt{n})

Therefore:

2a=1mna=2n ⁣(12lnn+γ)+O(n)=nlnn+2γn+O(n)2\sum_{a=1}^{m}\left\lfloor\frac{n}{a}\right\rfloor = 2n\!\left(\frac{1}{2}\ln n + \gamma\right) + O(\sqrt{n}) = n\ln n + 2\gamma n + O(\sqrt{n})

Subtracting m2=n+O(n)m^2 = n + O(\sqrt{n}):

D(n)=nlnn+2γnn+O(n)=nlnn+(2γ1)n+O(n)D(n) = n\ln n + 2\gamma n - n + O(\sqrt{n}) = n\ln n + (2\gamma-1)n + O(\sqrt{n})

\blacksquare


The error term — the open problem

Dirichlet showed the error is O(n)O(\sqrt{n}). In 1903, Voronoï improved this to O(n1/3logn)O(n^{1/3}\log n).

The conjecture — called the Dirichlet Divisor Conjecture — is that the error is O(n1/4+ε)O(n^{1/4+\varepsilon}) for any ε>0\varepsilon > 0.

The lower bound Ω(n1/4)\Omega(n^{1/4}) is known — the error is at least this large infinitely often.

The best upper bound (Huxley, 2003): O(n131/416)O(n^{131/416}) where 131/4160.3149131/416 \approx 0.3149.

The gap between 0.250.25 (conjecture) and 0.31490.3149 (best known) has not closed in over 20 years.


Why 2γ12\gamma - 1?

The constant 2γ10.15442\gamma - 1 \approx 0.1544 arises from two sources:

  • 2γ2\gamma: from the harmonic sum approximation, with the Euler-Mascheroni constant appearing twice (once from each side of the symmetry argument)
  • 1-1: from subtracting m2nm^2 \approx n

The fact that γ\gamma appears here — the same constant that measures the gap between HnH_n and lnn\ln n — is not a coincidence. Both come from approximating a discrete sum by a continuous integral over 1/x1/x.


Consequences and connections

Average divisor count. τ(1)++τ(n))/nlnn\tau(1) + \cdots + \tau(n))/n \sim \ln n. A typical integer near nn has about lnn\ln n divisors.

Highly composite numbers. Numbers with unusually many divisors (like 12, 24, 60, 120...) are the outliers — they pull the average up. Most numbers near them have far fewer divisors.

Connection to Riemann zeta function. The Dirichlet series:

n=1τ(n)ns=ζ(s)2\sum_{n=1}^{\infty} \frac{\tau(n)}{n^s} = \zeta(s)^2

where ζ(s)=ns\zeta(s) = \sum n^{-s} is the Riemann zeta function. The divisor problem is equivalent to understanding the behavior of ζ(s)2\zeta(s)^2 near s=1s=1.

The Riemann Hypothesis (on the zeros of ζ\zeta) would imply the Dirichlet Divisor Conjecture — but neither is proved.


Worked problems

Problem 1. Verify Dirichlet's formula for n=10n = 10.

D(10)=27D(10) = 27 (computed earlier).

Formula: 10ln10+(2×0.57721)×10=23.026+1.544=24.5710\ln 10 + (2\times 0.5772 - 1)\times 10 = 23.026 + 1.544 = 24.57.

Error: 2724.57=2.4327 - 24.57 = 2.43. And 103.16\sqrt{10} \approx 3.16. Error is well within O(n)O(\sqrt{n}). ✓

Problem 2. Estimate the number of (a,b,c)(a,b,c) triples with abcnabc \leq n.

Generalizing: #{abcn}=k=1nτ3(k)\#\{abc \leq n\} = \sum_{k=1}^{n} \tau_3(k) where τ3(k)\tau_3(k) counts ordered triples (a,b,c)(a,b,c) with abc=kabc = k.

By a similar lattice point argument: k=1nτ3(k)n2(lnn)2\sum_{k=1}^{n}\tau_3(k) \sim \frac{n}{2}(\ln n)^2.

Problem 3. Show that τ(n)=O(nε)\tau(n) = O(n^\varepsilon) for any ε>0\varepsilon > 0.

For any fixed ε>0\varepsilon > 0, τ(n)<nε\tau(n) < n^\varepsilon for all sufficiently large nn. (The divisor function grows slower than any power of nn.)

Proof sketch. For n=p1a1pkakn = p_1^{a_1}\cdots p_k^{a_k}: τ(n)=(ai+1)\tau(n) = \prod(a_i+1). Each factor (ai+1)2ai(a_i+1) \leq 2a_i for ai1a_i \geq 1, and ailog2na_i \leq \log_2 n. The number of prime factors klog2nk \leq \log_2 n. So τ(n)2k2log2n=n\tau(n) \leq 2^k \leq 2^{\log_2 n} = n. With more careful bounds, τ(n)=O(nε)\tau(n) = O(n^\varepsilon). \blacksquare

Problem 4. If τ(n)=n/10\tau(n) = n/10, what can you say about nn?

From τ(n)=O(nε)\tau(n) = O(n^\varepsilon), τ(n)\tau(n) grows much slower than nn. So τ(n)=n/10\tau(n) = n/10 is impossible for large nn. Checking small values: the equation τ(n)=n/10\tau(n) = n/10 would require n=10n = 10 with τ(10)=41\tau(10)=4 \neq 1, n=20n=20 with τ(20)=62\tau(20)=6\neq 2... no solutions exist beyond trivial cases.


The thread so far

floor functionlattice pointshyperbola areamedian paradoxDirichlet’s theorem\text{floor function} \to \text{lattice points} \to \text{hyperbola area} \to \text{median paradox} \to \text{Dirichlet's theorem}

Each page in this thread answered one question and raised the next. The floor function counted multiples. Lattice points connected counting to geometry. The hyperbola's area gave the logarithm. The median showed the skewness concretely. Dirichlet's theorem gave the precise asymptotic.

The open question — how sharp is the error O(n)O(\sqrt{n}) — remains. The answer, if it comes, will require tools from complex analysis far beyond this thread.