Geometry

Sums of powers, read off a staircase

Add the first n squares, or cubes, or seventh powers, and the answer is always a polynomial in n. Its first term is the area under a curve, its second is half of the last step, and every term after that is a correction for the corners of a staircase — which is where the Bernoulli numbers come from, and why they eventually grow without bound.

Worth reading first: Every square is a stack of odd numbers.

The odd numbers stack into squares, two triangles make a rectangle, six stepped pyramids make a box, and the cubes add up to the square of a triangular number. Each of those identities gives a sum of powers — 1+2++n1 + 2 + \cdots + n, or 12+22++n21^2 + 2^2 + \cdots + n^2, or the cubes — as a closed formula, and each has its own picture. By the fourth powers the pictures run out: a sum of fourth powers would need a five-dimensional stack, and nobody draws those.

The formulas do not run out. For every power mm the sum 1m+2m++nm1^m + 2^m + \cdots + n^m is a polynomial in nn of degree m+1m + 1, and there is a single picture that explains all of them at once. It is not a stack. It is a staircase standing on a curve.

The staircase and the curve

Draw a bar of width one and height kmk^m over each interval from k1k - 1 to kk. The bars’ total area is the sum. Draw the curve y=xmy = x^m across the same interval from 00 to nn. The curve passes through the top right-hand corner of every bar, and between those corners it bends under the bars’ flat tops.

The sum of the first 8 whole numbers, as a staircase over a curve. Bars of height k^1 for k from 1 to 8, totalling 36, drawn over the curve y = x^1, whose area up to 8 is 32.00. The slivers between staircase and curve hold 4.00, close to half the last bar.
Fig. 1 The whole numbers 1 to 8 as bars over the line y=xy = x. The bars add to 36; the triangle under the line has area 32; and the eight small slivers between hold the other 4 — exactly half the last bar.

For the first powers the picture is exact and familiar. The region under y=xy = x from 00 to nn is a triangle of area n2/2n^2/2. Each bar pokes above the line by a small triangle of area 12\tfrac12, and there are nn of them, so the slivers hold n/2n/2. The sum is n2/2+n/2n^2/2 + n/2, which is the triangular number n(n+1)/2n(n+1)/2 — the same formula the doubled staircase gave, now read as area under the line plus the slivers above it.

For squares the curve bends and the slivers are no longer triangles.

The sum of the first 6 squares, as a staircase over a curve. Bars of height k^2 for k from 1 to 6, totalling 91, drawn over the curve y = x^2, whose area up to 6 is 72.00. The slivers between staircase and curve hold 19.00, close to half the last bar.
Fig. 2 The squares 1 to 36 as bars over the curve y=x2y = x^2. The bars add to 91; the area under the curve up to 6 is 63/3=726^3/3 = 72; the slivers hold 19, and half the last bar is 18.

The area under y=x2y = x^2 from 00 to 66 is 7272, which is the dominant part of 91. The slivers hold 19. Half the last bar is 18, which accounts for almost all of them. And the leftover 1 is a sixth of 6. Put together:

12+22++n2=n33+n22+n6,1^2 + 2^2 + \cdots + n^2 = \frac{n^3}{3} + \frac{n^2}{2} + \frac{n}{6},

which is n(n+1)(2n+1)/6n(n+1)(2n+1)/6, the pyramid formula, multiplied out. The three terms are three different things: the area under the curve, a correction of half a step, and a correction to the correction.

Why the second term is always one half

The slivers above the curve are nearly triangles, and their size can be estimated without knowing the power.

Over the interval from k1k - 1 to kk the bar’s top is at height kmk^m and the curve rises from (k1)m(k-1)^m to kmk^m. If the curve were straight across that interval, the sliver would be a triangle of base one and height km(k1)mk^m - (k-1)^m, with area half of that. Adding those half-differences from k=1k = 1 to nn telescopes: everything cancels except 12nm\tfrac12 n^m. So the slivers hold about half the last bar, for any power, and the second term of every formula is nm/2n^m/2.

The approximation is that the curve is straight across each unit interval, and it is not quite. A curve that bends upward — as xmx^m does for m2m \ge 2 — sags below its chord, so each sliver is slightly larger than the triangle, by an amount that depends on how sharply the curve bends. That excess is the third term, and it is where the power starts to matter.

The sum of the first 6 cubes, as a staircase over a curve. Bars of height k^3 for k from 1 to 6, totalling 441, drawn over the curve y = x^3, whose area up to 6 is 324.00. The slivers between staircase and curve hold 117.00, close to half the last bar.
Fig. 3 The cubes as bars over y=x3y = x^3. The bars add to 441, the square of the triangular number 21; the curve’s area up to 6 is 324; the slivers hold 117, and half the last bar is 108.

For cubes the numbers are 441 in the bars, 324 under the curve, 117 in the slivers and 108 for the half-step, leaving 9. The polynomial is

13+23++n3=n44+n32+n24,1^3 + 2^3 + \cdots + n^3 = \frac{n^4}{4} + \frac{n^3}{2} + \frac{n^2}{4},

and 62/4=96^2/4 = 9. The picture of the cubes as the square of a triangular number is still true — (n(n+1)/2)2(n(n+1)/2)^2 multiplies out to exactly this — but now it has a second reading: an integral, a half-step, and a curvature correction.

Every coefficient, exactly

The pattern continues for every power, and the coefficients can be computed exactly as fractions.

Sums of powers as polynomials, for powers 1 to 6. A table of the coefficients of the polynomials giving 1^m + … + n^m for m from 1 to 6. Each has leading coefficient 1/(m+1) and next coefficient 1/2.
Fig. 4 The polynomials for powers 1 to 6, every coefficient an exact fraction and each checked against the direct sum for nn up to 25. The first coefficient in each row is 1/(m+1)1/(m+1), the second is always 1/21/2, the third is m/12m/12, and after that every other coefficient is nought.

Three diagonals of the table are forced. The leading coefficient is 1/(m+1)1/(m+1), the area under xmx^m. The next is 1/21/2, the half-step. The third is m/12m/12 — for squares 2/12=1/62/12 = 1/6, for cubes 3/12=1/43/12 = 1/4, for fourth powers 4/12=1/34/12 = 1/3. After that the coefficients alternate between nought and a fraction, and the fractions look unrelated: 1/30-1/30, 1/12-1/12, 1/421/42, 1/6-1/6.

They are related. Every coefficient in the table is a binomial coefficient times one of a single sequence of numbers:

1m++nm=1m+1j=0m(m+1j)Bjnm+1j,1^m + \cdots + n^m = \frac{1}{m+1}\sum_{j=0}^{m} \binom{m+1}{j} B_j\, n^{m+1-j},

where B0=1B_0 = 1, B1=12B_1 = \tfrac12, B2=16B_2 = \tfrac16, B3=0B_3 = 0, B4=130B_4 = -\tfrac1{30}, B5=0B_5 = 0, B6=142B_6 = \tfrac1{42}, and so on. Those are the Bernoulli numbers. Johann Faulhaber had worked out the polynomials up to the seventeenth power by 1631 without recognising the pattern in their coefficients; Jacob Bernoulli found it and published it in 1713, remarking that he had computed the sum of the tenth powers of the first thousand numbers in under half a quarter of an hour.

The number he got is 91,409,924,241,424,243,424,241,924,242,500, and its strange near-repetitions are the polynomial showing through. With n=1000n = 1000 each power of nn is a one followed by threes of zeros, so the terms of the degree-eleven polynomial land in overlapping blocks of digits, and the answer is the decimal expansions of the coefficients 1/111/11, 1/21/2, 5/65/6, 1-1, 11, 1/2-1/2 and 5/665/66 laid over one another, each shifted three digits for every power of nn it drops. A sum that would take thousands of multiplications becomes the coefficients of one row of the table written out side by side. Seki Takakazu found the same numbers independently in Japan, in a book published in 1712, a year before Bernoulli’s.

The third term is curvature

The picture says what each term is, and it says it most clearly for the third.

The correction after the integral and the half-step. For powers 2, 3, 4, 5, the remainder of the sum of powers after its first two terms, scaled by n^(m−1), settling on m/12.
Fig. 5 For powers 2 to 5, what is left of the sum after subtracting the area under the curve and the half-step, divided by nm1n^{m-1}. Each curve settles on m/12m/12, dashed. For squares and cubes the remainder is exactly m/12m/12 from the start, because the polynomial stops there; for fourth and fifth powers it approaches from below.

The sliver over the interval from k1k-1 to kk exceeds the chord’s triangle by the area between the chord and the curve. For a smooth curve that area is about 112\tfrac1{12} times the curve’s second derivative there — the familiar error of the trapezium rule. The second derivative of xmx^m is m(m1)xm2m(m-1)x^{m-2}, and adding 112m(m1)km2\tfrac1{12}m(m-1)k^{m-2} from k=1k = 1 to nn gives, to leading order, 112mnm1\tfrac1{12} m\, n^{m-1}. The third coefficient is the trapezium rule’s error summed along the staircase, and m/12m/12 is what it comes to.

The general statement is the Euler–Maclaurin formula. For any smooth function ff, the sum f(1)++f(n)f(1) + \cdots + f(n) equals the integral of ff, plus half the difference of its end values, plus B2/2!B_2/2! times the difference of its first derivative at the ends, plus B4/4!B_4/4! times the difference of its third derivative, and so on — one term for each odd derivative, weighted by a Bernoulli number, plus a remainder. For f(x)=xmf(x) = x^m the derivatives run out after mm steps, the remainder vanishes, and the formula is Faulhaber’s polynomial exactly. For any other function the derivatives never run out and the formula is an infinite series of corrections.

The odd-indexed Bernoulli numbers past B1B_1 are all nought for a reason the picture also supplies. The function x/(ex1)+x/2x/(e^x - 1) + x/2, whose Taylor coefficients generate the Bernoulli numbers, is even — and an even function has no odd powers. In the staircase that symmetry is the observation that a correction for curvature cannot depend on which way the staircase is read, so only even derivatives of the error can appear.

The corrections that eventually grow

The corrections for a polynomial stop. For a function like logx\log x or 1/x1/x they do not, and whether an infinite list of corrections converges depends on how big the Bernoulli numbers get.

The Bernoulli numbers up to B₃₀. The absolute values of the even-indexed Bernoulli numbers up to index 30 on a logarithmic scale, shrinking to a minimum near index 6 and then growing like 2(2k)!/(2π)^(2k).
Fig. 6 The Bernoulli numbers B2,B4,,B30|B_2|, |B_4|, \dots, |B_{30}| on a logarithmic scale, with 2(2k)!/(2π)2k2(2k)!/(2\pi)^{2k} as a dashed curve. They shrink to a smallest value at B6=1/42B_6 = 1/42 and then grow faster than any exponential: B30=8615841276005/14322B_{30} = 8615841276005/14322, about 6×1086 \times 10^8. Red dots are negative values; the signs alternate.

They get very big. After a few small values the sizes grow like 2(2k)!/(2π)2k2\,(2k)!/(2\pi)^{2k}, which outruns every exponential because of the factorial. So in the Euler–Maclaurin series for a function like 1/x1/x, the terms first shrink — each correction smaller than the last — reach a smallest term, and then grow without limit. The series diverges for every function that is not a polynomial.

That does not make it useless; it makes it an asymptotic series. Stopping at the smallest term gives an approximation whose error is about the size of that term, and for large nn that error is fantastically small. Euler used exactly this to compute the constant γ=0.5772\gamma = 0.5772\ldots — the amount by which the harmonic series exceeds logn\log n — to sixteen decimal places, adding ten terms by hand and correcting with a handful of Bernoulli numbers, at a time when adding up enough terms directly would have taken longer than the age of the universe.

The twelve in Stirling’s formula

The same corrections, applied to a function whose sum everybody needs, produce a constant that is usually presented as a mystery.

The logarithm of n!n! is log1+log2++logn\log 1 + \log 2 + \cdots + \log n, a staircase over the curve y=logxy = \log x. The integral of logx\log x from 1 to nn is nlognn+1n\log n - n + 1. The half-step is 12logn\tfrac12\log n. The curvature correction involves the first derivative of logx\log x, which is 1/x1/x, weighted by B2/2!=1/12B_2/2! = 1/12. Putting the pieces together, and collecting everything that does not depend on nn into one constant,

logn!=nlognn+12logn+C+112n1360n3+.\log n! = n\log n - n + \tfrac12\log n + C + \frac{1}{12n} - \frac{1}{360n^3} + \cdots.

The constant turns out to be 12log2π\tfrac12\log 2\pi, which is where the 2πn\sqrt{2\pi n} in Stirling’s formula comes from, and the 112n\frac{1}{12n} is the first correction that makes the formula accurate enough to use for small nn. That twelve is the same twelve as in the m/12m/12 of the table — the trapezium rule’s curvature error — and the 1360\frac{1}{360} after it is B4/(43)B_4/(4 \cdot 3). Stirling’s series is the Euler–Maclaurin series for the logarithm, and like every such series for a non-polynomial it diverges: its terms shrink for a while at any fixed nn and then grow, with the turning point further out the larger nn is.

That series is what sits behind the πd/2\sqrt{\pi d/2} in the average room at which a shared birthday first appears, where factorials in the all-distinct product had to be estimated. A problem about people and days reaches its π\pi through a staircase over a logarithm.

Who needed these sums, and for what

The formulas were not wanted for their own sake. Every one of them was first needed to find an area or a volume, and the history runs exactly parallel to the picture.

Archimedes needed the sum of the squares to find the area inside a spiral and the area of a parabolic segment, and he proved it by the same kind of bounding from above and below that he used to pin the area of a circle between two sequences. Around the year 1000 Ibn al-Haytham needed the sum of the fourth powers to find the volume of a paraboloid, and derived it — an argument that, written in modern notation, is the step from one power to the next that Faulhaber’s table encodes. In the seventeenth century Cavalieri, Fermat and Pascal each used sums of powers to find the area under y=xmy = x^m, and it was the recognition that the answer is nm+1/(m+1)n^{m+1}/(m+1) for every mm that became one of the first general theorems of integration, and the slicing method Cavalieri built on it.

The picture reverses the direction of that history. Those mathematicians found the sums of powers in order to compute areas under curves. Once the areas were known the relationship could be run the other way, and the area became the leading term of the sum, with the Bernoulli numbers keeping the accounts for the difference.

Where the dashed curve comes from

The dashed curve in the figure is not a fit, and the reason it matches the Bernoulli numbers to within two per cent from B6B_6 on is one of the more surprising connections in elementary mathematics.

The exact relation is

B2k=(1)k+12(2k)!(2π)2k  ζ(2k),ζ(s)=1+12s+13s+.B_{2k} = (-1)^{k+1}\,\frac{2\,(2k)!}{(2\pi)^{2k}}\;\zeta(2k), \qquad \zeta(s) = 1 + \frac1{2^s} + \frac1{3^s} + \cdots.

The sum ζ(2k)\zeta(2k) is between 1 and π2/6\pi^2/6, and it tends to 1 quickly as kk grows, because the terms after the first become negligible. So the Bernoulli numbers are the factorial curve times a factor that barely differs from one. Read the other way, the relation gives the values of the zeta function at even integers: ζ(2)=π2/6\zeta(2) = \pi^2/6, which Fourier’s coefficients deliver by a completely different route, ζ(4)=π4/90\zeta(4) = \pi^4/90, and every ζ(2k)\zeta(2k) as a rational multiple of π2k\pi^{2k} with a Bernoulli number in it.

So the coefficients that correct a staircase for its corners are the same numbers that sum the reciprocals of the even powers. The 2π2\pi in the formula is there because the generating function x/(ex1)x/(e^x - 1) has poles at ±2πi\pm 2\pi i, which set the radius of convergence of its Taylor series and therefore the growth rate of its coefficients — a fact about complex numbers controlling the size of rational numbers that were first met adding up whole-number powers.

What nothing drawn here establishes

The staircases are drawn for powers one, two and three at six to eight steps, and the table checks each polynomial against direct sums for nn up to 25. That is evidence that the formulas are right and a proof of nothing: the polynomial identity for a given power is proved by induction on nn, or by the telescoping of (k+1)m+1km+1(k+1)^{m+1} - k^{m+1}, and no finite table does that work.

The explanation of the second and third terms as a half-step and a curvature correction is an argument about areas, and it is exact only in the limit. At six steps the slivers are visibly not triangles, and the decomposition of 19 into 18 and 1 is a statement about the polynomial rather than something the drawn shapes can be measured to show.

And the divergence of the Euler–Maclaurin series cannot be seen in any picture of a staircase, because it concerns the corrections for a non-polynomial function continued to very high order. The Bernoulli numbers’ growth is the evidence, and it is shown only up to B30B_{30}.

A curve that explains the triangular numbers again

The staircase reading also connects back to the figurate numbers where this started. The triangular number n(n+1)/2n(n+1)/2 is the first staircase, and the eight-triangles picture that turns every odd square into eight triangles and a dot is a statement about how staircases of that kind fit inside squares. The pyramid numbers are the second staircase, and the six pyramids in a box are the polynomial n3/3+n2/2+n/6n^3/3 + n^2/2 + n/6 multiplied by six and read as a solid. Each dimension has its own trick, and the tricks stop at three.

What the staircase over a curve replaces them with is a single mechanism: an integral for the bulk, a half-step for the edge, and an infinite family of corrections for the corners, each one a finer measurement of how the flat top of a bar differs from the curve it sits on. It works for every power and extends to every smooth function, and the same comparison of bars with a curve that defines the integral turns out, carried to its corrections, to be the thing that computes the sums the integral was defined to approximate.

Still open: whether the odd zeta values are like the even ones

The even zeta values are rational multiples of powers of π\pi, with a Bernoulli number fixing the rational, and all of them are transcendental because π\pi is. Nothing like that is known for the odd values. ζ(3)=1.2020569\zeta(3) = 1.2020569\ldots was proved irrational by Roger Apéry in 1978, in an argument so unexpected that it was checked line by line before anyone believed it. Since then it has been shown that infinitely many of ζ(5),ζ(7),ζ(9),\zeta(5), \zeta(7), \zeta(9), \dots are irrational, and that at least one of ζ(5),ζ(7),ζ(9),ζ(11)\zeta(5), \zeta(7), \zeta(9), \zeta(11) is.

Nobody knows whether ζ(5)\zeta(5) is irrational, and nobody knows whether ζ(3)\zeta(3) is a rational multiple of π3\pi^3 — the analogue of the even case — though it is universally expected not to be. The Bernoulli numbers answer the even half of the question completely, and there is no known sequence of rational numbers that plays their part for the odd half.

The polynomial in every staircase

A sum of whole-number powers looks like the most discrete thing imaginable, a list of integers added up. Its formula turns out to be a continuous object — the area under a curve — with a sequence of corrections, and the corrections are organised by one list of rational numbers that shows up again in the zeta function, in the trapezium rule, and in the Taylor series of x/(ex1)x/(e^x - 1).

The staircase is the reason. A bar has a flat top and a curve does not, and every term after the first is a more precise account of that one difference: half a step, then the bend, then the bend of the bend — a list that stops for polynomials and, for everything else, first shrinks and then grows past every bound.

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.

ApproximationAsymptotic seriesError termFigurate numbersIntegralPolynomialRiemann sumTriangular numbers