Number

The shape of a number's divisors

Lay a number's divisors out as a lattice with one axis per prime, and two of the most useful facts in arithmetic stop being formulas and become the width and the corner of a rectangle.

Worth reading first: One way to factor, and no other.

A number’s divisors are usually met as a list: the divisors of sixty are one, two, three, four, five, six, ten, twelve, fifteen, twenty, thirty and sixty. A list is the least informative arrangement available, because the order it is written in — increasing — has nothing to do with how the divisors are related.

The divisors of 60Every divisor as a lattice point, one axis per prime, joined when one divides the other by a single prime.124361251020153060× 2 →× 3 ↑2^2 × 3 × 5 — 3 × 2 × 2 = 12 divisors
Fig. 1 The same twelve divisors, arranged by what they are made of. One axis per prime, one step per power of it; two divisors are joined when one divides the other by a single prime. The generator draws every divisor exactly once and checks the count against the exponents.

Every divisor of 60=22×3×560 = 2^2 \times 3 \times 5 is 2i3j5k2^i 3^j 5^k with i2i \le 2, j1j \le 1, k1k \le 1, and nothing else is. So the divisors are the whole-number points of a box: three choices along one axis, two along each of the others.

Two facts fall straight out of the shape, and both of them are usually taught as formulas to be memorised.

The count is the box

How many divisors does 6060 have? However many points are in a 3×2×23 \times 2 \times 2 box, which is twelve. In general, for n=p1e1pkekn = p_1^{e_1} \cdots p_k^{e_k},

d(n)=(e1+1)(e2+1)(ek+1).d(n) = (e_1 + 1)(e_2 + 1) \cdots (e_k + 1).

The +1+1 is the choice of taking none of that prime, and the multiplication is the independence of the choices.

The divisors of 12Every divisor as a lattice point, one axis per prime, joined when one divides the other by a single prime.1243612× 2 →× 3 ↑2^2 × 3 — 3 × 2 = 6 divisors
Fig. 2 A smaller box: 12=22×312 = 2^2 \times 3 has divisors at the six points of a 3×23 \times 2 rectangle. There is no third axis because there is no third prime, which is why 1212 has half as many divisors as 6060 despite being only five times smaller.

The formula depends entirely on the fundamental theorem. If a number had two different factorisations, “the exponent of pp in nn” would not name anything, the box would have no dimensions, and the count would be meaningless. Unique factorisation is what makes the coordinates well defined, and the lattice is the theorem drawn.

It also explains why the divisor count is so irregular. Highly composite numbers — 1212, 6060, 360360, 25202520 — are the ones whose exponents are arranged to make the box large for the number’s size, which means many small primes with modest exponents. A large prime contributes only a factor of two to the count while multiplying the number by itself. So the numbers with many divisors are the ones built from the smallest primes available, and Ramanujan’s study of them in 1915 is essentially an optimisation over the shape of this box.

The sum factorises because the rectangle does

Adding the divisors up looks like a harder question and is the same one.

The divisors of 72 as a rectanglePowers of one prime across, powers of the other down; every divisor appears once.91836723612241248122^22^3133^2= 15= 45= 1354 × 3 = 12 divisors, adding to 195and 195 = 15 × 13 — the row totals, which is why the divisor sum is multiplicative
Fig. 3 The divisors of 72=23×3272 = 2^3 \times 3^2 as a rectangle: powers of two across, powers of three down. Each row total is printed beside it, and the row totals are all multiples of the same number. The generator checks that the cells add to the divisor sum and that the sum factorises as the two row totals multiplied.

Row jj of the rectangle holds 3j×(1+2+4+8)3^j \times (1 + 2 + 4 + 8), so it totals 15×3j15 \times 3^j. Adding the rows gives 15×(1+3+9)=15×13=19515 \times (1 + 3 + 9) = 15 \times 13 = 195, and 195195 is the sum of all twelve divisors of 7272.

Nothing was rearranged: the rectangle was added by rows instead of cell by cell, and rows factor because the rectangle is a product. In general

σ(n)=i(1+pi+pi2++piei)=ipiei+11pi1,\sigma(n) = \prod_i \left(1 + p_i + p_i^2 + \cdots + p_i^{e_i}\right) = \prod_i \frac{p_i^{e_i + 1} - 1}{p_i - 1},

each bracket a finite geometric series, and the whole thing a distributed product.

This is counting one collection two ways in its purest form. The cells are the same cells; adding them one at a time gives a number with no structure, and adding them by rows gives the number written as a product. The identity is not proved so much as observed from a second reading of the same picture.

Multiplicative, and what that word is doing

A function ff on the whole numbers is multiplicative if f(mn)=f(m)f(n)f(mn) = f(m)f(n) whenever mm and nn are coprime. Both dd and σ\sigma are, and the lattice says why in one sentence: if mm and nn share no prime, their axes are different axes, and the divisor lattice of mnmn is the product of the two lattices.

The coprimality condition is not a technicality. d(4)=3d(4) = 3 and d(2)=2d(2) = 2, and d(8)=4d(8) = 4 rather than 66, because multiplying two numbers that share a prime stretches an existing axis instead of adding a new one. The lattice makes the distinction visible: a new prime is a new dimension, a repeated prime is a longer edge, and only the first of those multiplies the count.

Multiplicativity is what makes such functions tractable. Knowing ff on prime powers determines it everywhere, so a question about all numbers becomes a question about pep^e, which is one variable rather than infinitely many. Nearly every function in classical number theory is built this way — the divisor count, the divisor sum, Euler’s totient φ\varphi, the Möbius function — and each is defined on prime powers and extended by the product rule.

Euler’s totient is the one worth following, because its lattice reading is a subtraction rather than a count. φ(n)\varphi(n) counts the numbers below nn coprime to nn: those sharing no prime with it. On the box, “shares a prime with nn” means “lies on one of the coordinate hyperplanes”, so the coprime numbers are what is left when every hyperplane is removed — and inclusion–exclusion over the hyperplanes gives

φ(n)=npn(11p).\varphi(n) = n \prod_{p \mid n} \left(1 - \frac{1}{p}\right).

That product is the one the sieve’s density estimate is built from, arrived at here by a completely different route: there it was the fraction of numbers surviving a sequence of strikes, here it is the fraction of a box left after removing its faces. The two are the same calculation, and the shared appearance of (11/p)\prod(1 - 1/p) across half of this field is the reason so many results in it have a factor that looks like it belongs somewhere else.

Multiplicativity also has an unexpected consequence for the Farey sequences: their lengths are totient sums, so the number of fractions in lowest terms with denominator at most nn is governed by the same product, and grows like 3n2/π23n^2/\pi^2. The π\pi has no circle behind it. It comes from 1/k2\sum 1/k^2, which is where the totient sum’s average leads, and it is the clearest sign that these counting functions are not really about individual numbers at all.

The divisors of 200 as a rectanglePowers of one prime across, powers of the other down; every divisor appears once.255010020051020401248122^22^3155^2= 15= 75= 3754 × 3 = 12 divisors, adding to 465and 465 = 15 × 31 — the row totals, which is why the divisor sum is multiplicative
Fig. 4 200=23×52200 = 2^3 \times 5^2, a different rectangle with the same behaviour. The row totals are 3131 and the column structure gives 1+5+251 + 5 + 25, and 31×31=46531 \times 31 = 465 is the divisor sum. The shape changed; the argument did not.

How the count behaves on average

The divisor count jumps about violently — a prime has two divisors and the number next door may have twenty — so the useful question is what it does on average, and the answer comes from counting a region two ways.

Add d(n)d(n) over all nn up to xx. That total counts the pairs (d,q)(d, q) with dqxdq \le x, since each divisor dd of each nn gives exactly one such pair. Those pairs are the lattice points under the hyperbola dq=xdq = x, and counting them by columns gives

nxd(n)=dxxdxlogx.\sum_{n \le x} d(n) = \sum_{d \le x} \left\lfloor \frac{x}{d} \right\rfloor \approx x \log x.

So the average number of divisors of a number near xx is about logx\log x — which is small. A number near a million has, on average, about fourteen divisors.

The hyperbola trick is Dirichlet’s, and it is the same manoeuvre as the row-summing above at a larger scale: a two-dimensional region is being counted by slices rather than point by point, and the slices are easy while the points are not. Dirichlet went further and used symmetry about the line d=qd = q to improve the error term, which is why the sharp version reads xlogx+(2γ1)x+O(x)x \log x + (2\gamma - 1)x + O(\sqrt x). Improving that x\sqrt x is the divisor problem, it has been open since 1849, and the current record is an exponent of about 0.3140.314 against a conjectured 14\tfrac14.

That is a familiar shape by now. An exact statement about a lattice is available immediately; the error in the approximation is the hard part; and the hard part has been open for a century and a half.

The one place the picture stops

The lattice is drawable for one, two or three distinct primes. A number with four is a four-dimensional box, and any drawing of it is a projection making claims a reader cannot check.

That is a real limitation rather than a presentational one. The numbers with many distinct prime factors are exactly the interesting ones for questions about divisor counts, and they are the ones outside the drawing. 2310=2×3×5×7×112310 = 2 \times 3 \times 5 \times 7 \times 11 has 3232 divisors sitting at the corners of a five-dimensional cube, and the fact that every divisor corresponds to a subset of the primes is clear from the algebra and invisible in any picture.

What the pictures do carry across is the reasoning, and that generalises where the drawing does not. A box in five dimensions is still a product of five independent choices, its point count is still a product, and adding its entries by hyperplanes still factorises the sum. The arguments in this essay are all one-dimensional arguments repeated, which is why they survive into dimensions no figure reaches.

What the divisors add up to

The natural next question is which numbers have divisor sums worth remarking on, and the classical answer is a strange one.

Proper divisors, added upFor each number, its proper divisors laid end to end against the number itself.6the number itself236 — perfect12the number itself234616 — abundant16the number itself24815 — deficient28the number itself2471428 — perfect30the number itself2356101542 — abundantthe top bar of each pair is the divisors; the bottom is the number they came from
Fig. 5 For each number, its proper divisors laid end to end against the number itself. Sixteen falls short, twelve and thirty overshoot, and six and twenty-eight land exactly. The generator computes each sum from the divisor list rather than looking it up.

A number is deficient if its proper divisors add to less than itself, abundant if more, and perfect if exactly. Perfection is rare — six, twenty-eight, four hundred and ninety-six, eight thousand one hundred and twenty-eight — and rare in a way that is still not understood, which is the subject of its own essay.

The lattice explains the general tendency, if not the exceptional cases. A number’s divisor sum relative to the number itself, σ(n)/n\sigma(n)/n, equals (1+1/p++1/pe)\prod (1 + 1/p + \cdots + 1/p^{e}), which is bounded by (11/p)1\prod (1 - 1/p)^{-1}: it grows with the number of small primes and barely responds to large ones. So abundance is a property of being built from many small primes, and every multiple of six above six is abundant for exactly that reason.

The distribution of σ(n)/n\sigma(n)/n turns out to be well behaved in a way none of the individual values are. Davenport showed in 1933 that the proportion of numbers with σ(n)/n\sigma(n)/n below any given threshold exists as a limit — the ratio has a genuine distribution function, continuous and strictly increasing. The abundant numbers therefore have a density, and it is about 0.24760.2476: roughly one number in four has divisors adding to more than itself.

That a quantity this erratic has a smooth distribution is characteristic of the whole field. Individual values are unpredictable, statistics over them are not, and the bridge between the two is always multiplicativity — the ratio is a product over primes, the primes behave independently enough for the product to have a distribution, and the erratic behaviour averages out without ever becoming predictable.

Möbius, and reading the lattice backwards

There is one more thing the box is good for, and it is the operation that inverts everything above.

Suppose a function FF is defined as the sum of ff over the divisors of nn — as σ\sigma is the sum of the identity, and dd the sum of the constant one. Möbius inversion recovers ff from FF:

f(n)=dnμ(d)F(n/d),f(n) = \sum_{d \mid n} \mu(d)\, F(n/d),

where μ(d)\mu(d) is zero if dd has a repeated prime factor, and otherwise ±1\pm 1 according to the parity of the number of primes.

Drawn on the lattice, μ\mu is a signed sum over the corners of the box with the interior thrown away, and the inversion is inclusion–exclusion: add over everything, subtract the over-counting on each face, add back the double-subtraction on each edge. The Möbius function is zero away from the corners precisely because inclusion–exclusion has nothing to say about a repeated prime.

This is the same alternating count that appears in the sieve’s density estimate, and it is the reason the two subjects share machinery: sieving is inclusion–exclusion over the primes dividing something, and Möbius inversion is inclusion–exclusion over the divisors of something. The lattice is where both of them live.

The lattice is an order, not just a picture

The joins in the first figure are not decoration. Two divisors are connected when one divides the other by a single prime, and following the connections upward is the divisibility relation — so the drawing is a Hasse diagram of a partial order, and everything a partial order has, this one has.

It has a bottom element, 11, and a top, nn. Any two divisors have a greatest lower bound, their gcd\gcd, and a least upper bound, their lcm\mathrm{lcm}; on the lattice those are the componentwise minimum and maximum of the exponent vectors, which is why gcd(a,b)×lcm(a,b)=ab\gcd(a,b) \times \mathrm{lcm}(a,b) = ab — the minimum and the maximum of two numbers add to their sum, coordinate by coordinate. That identity is usually proved by a page of case analysis and is one line of the picture.

The divisors of 360Every divisor as a lattice point, one axis per prime, joined when one divides the other by a single prime.1248361224918367251020401530601204590180360× 2 →× 3 ↑2^3 × 3^2 × 5 — 4 × 3 × 2 = 24 divisors
Fig. 6 360=23×32×5360 = 2^3 \times 3^2 \times 5: a 4×3×24 \times 3 \times 2 box holding twenty-four divisors, drawn with the third prime as a shear. The corners are 11 and 360360; a path from bottom to top is a way of building the number one prime at a time, and there are as many such paths as there are orderings of its prime factors.

The order structure also answers a question the list arrangement makes hard: how many chains run from 11 to nn? A chain multiplies one prime at a time, so it is an ordering of the multiset of prime factors, and there are (e1++ek)!e1!ek!\frac{(e_1 + \cdots + e_k)!}{e_1! \cdots e_k!} of them — for 360360, with factors 2,2,2,3,3,52,2,2,3,3,5, that is 6060. The divisor lattice of a number is the same object as the set of ways of arranging a word with repeated letters, which is not a resemblance anybody would predict from either description.

Where the ladder goes next

The immediate continuation is the exceptional case the aliquot figure showed. Numbers that are the sum of their own parts takes the divisor sum as the object of study rather than as a tool, and gets a complete answer for even numbers and no answer at all for odd ones.

The other direction is a different kind of counting entirely. This essay counted the ways a number can be factored, arranging the results in a box. Counting the ways a number can be added up gives partitions, where the arrangement is a diagram of dots and turning it on its side proves things that no formula suggests. The two are the multiplicative and additive halves of the same question, and they behave nothing like each other.

What links here

Computed from the collection, not written here: the essays that point at this one.

Reads more easily once this is understood

Essays that name this one as worth reading first.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

Counting two waysDivisor functionDivisor sumGeometric seriesHasse diagramLatticeMultiplicative functionPerfect numberUnique factorisation