The digits a slow series gets wrong
Worth reading first: Turning a slow series geometric · The tangent counts zigzags.
The series , found by Madhava in India and rediscovered by Gregory and Leibniz, and summed at its endpoint only with the care that Abel’s theorem supplies, is the textbook example of a series that converges too slowly to use, and the series everything else is measured against — the geometric one — is the opposite case, gaining a fixed number of digits with every term. Its terms shrink like , and an alternating series with terms that size is in error, after terms, by about half the next term: to get to six decimals by summing it takes about a million terms. Turning a slow series geometric measured what acceleration methods do to it, and the answer was a great deal; left alone, it gains one digit for every tenfold increase in work, and so does its neighbour the sum after Leibniz’s, Catalan’s constant .
So it is a surprise to sum exactly 500,000 terms, multiply by four, and look at the result to sixty decimal places. The sixth decimal is wrong, as the size of the error predicts: the partial sum is 3.141590…, and is 3.141592…. But the next ten decimals are right. So are most of the forty after those. Of the first sixty decimals, only ten differ from , and they come in small clusters separated by long correct stretches.
The phenomenon was noticed by Joseph North in 1988 and explained the next year by Jonathan Borwein, Peter Borwein and Karl Dilcher. The explanation is short and exact, and it says the clusters of wrong digits are the Euler numbers — the same numbers that count alternating permutations — written out in decimal. This essay computes the partial sums exactly, in integer arithmetic to ninety decimals, and draws the structure the explanation predicts.
Sixty decimals, ten of them wrong
The figure writes the two numbers one above the other in groups of five. The partial sum is 3.14159 06535 89793 24046 26433 83269 50288 41972 91399 37510 30509 74944, and is 3.14159 26535 89793 23846 26433 83279 50288 41971 69399 37510 58209 74944. The disagreements are at decimals 6, 17 and 18, 29, 40 to 42 and 51 to 53. Everything else agrees.
Subtracting the two numbers explains the pattern. The difference is
a sum of whole numbers times powers of ten, each power twelve places beyond the last. Each term disturbs only the few digits where it lands: a 2 at the sixth place, a 2 at the eighteenth, which with a borrow touches the seventeenth too, a 10 at the twenty-ninth and thirtieth, 122 at the fortieth to forty-second, 2,770 at the fifty-first to fifty-fourth. In between, the partial sum is exactly . The figure’s check is that six terms of this form, with the numerators below, reproduce the difference to seventy decimals.
The numerators are 2, −2, 10, −122, 2,770 and −101,042: twice 1, −1, 5, −61, 1,385, −50,521. These are the Euler numbers, the coefficients in the series for the secant, , with alternating signs. The secant has turned up in the error of a series for , and the number 500,000 was chosen so that twice it is a million, which makes every term of the error a whole number over a power of ten.
An integral with a hyperbolic cosine
The appearance of the secant is not a coincidence, and the derivation fits in a few lines. Each term of the series is an integral: . The tail of the series after terms is therefore a geometric series under an integral sign,
the oldest trick for alternating sums, a geometric series summed inside an integral, used here for the tail rather than the whole.
The factor is negligible except for near 0, so the integral is governed by the behaviour of there. That function is the hyperbolic secant, and its Taylor series is the secant’s with the signs alternating: , with , , , . Integrating term by term against , with , each power contributes exactly . So for even
and for odd the same with the sign reversed. With this is the expansion in the first figure. The structure was always there; choosing so that is a power of ten makes it legible in decimal.
Each correction, in turn
The expansion can be checked one term at a time, without relying on a single fortunate . Take the error for every even from 10 to 400 and multiply it by : the result tends to 1, the first Euler number, as the top-left panel shows. Subtract the first term, , and multiply what is left by : the result tends to . Subtract the second term and multiply by : the result tends to 5. One more: .
Each panel is a sharper test than the last, because each residual is smaller and each scaling factor larger, so a wrong coefficient at any stage would send the curve away from its line. All four curves converge, and they converge from the side and at the rate the next term predicts: at the fourth panel reads , short of by , the next Euler number making itself felt. The error of Leibniz’s series is, to every order that can be checked, the Euler numbers divided by powers of .
This is a characteristic way for a slow series to behave. Its error is not random-looking or erratic; it is a smooth function of with an expansion in inverse powers, and the expansion’s coefficients carry information about the function the series came from. The same is true of the sum that never stops growing, the harmonic series, whose partial sums differ from by with Bernoulli numbers in the coefficients, and for exactly the same reason: an integral representation and a Taylor series near zero.
A correction from Kerala
The expansion was not a modern discovery in every sense. The astronomers of the Kerala school, following Madhava in the fourteenth century, knew that the series for converges slowly and added an end correction to its partial sums: stop after terms and add, with the sign of the next term, a fraction . Three corrections appear in their texts, , and , each more accurate than the last.
Read against the Euler-number expansion, the three corrections are its first terms in disguise. With , four times is , the leading term. Four times is , which matches the first two terms. Four times is , which matches three: the Euler numbers 1, −1 and 5. The corrections are rational functions whose expansions agree with the true error as far as they go, which is to say they are the early convergents of a continued fraction for it — rational approximations of the kind that reach past a Taylor series’ radius because a denominator can carry what a polynomial cannot.
The effect is dramatic at small . Ten terms of the series give with an error of about 0.0998. With added the error is 0.00025; with , 0.0000024; with , 0.00000005 — seven correct decimals from ten terms, where the bare series would need tens of millions. The Kerala astronomers did not have the Euler numbers or the hyperbolic secant. They had the right corrections, and the corrections encode the same structure that makes the wrong digits at half a million terms fall where they do.
An expansion that does not converge
The expansion has one property that the first figure hides. It does not converge. The hyperbolic secant has poles at , so its Taylor series has radius of convergence , and its coefficients grow at the rate that forces, since a Taylor series can reach no further than the nearest singularity: is about , faster than any power. For fixed , the terms shrink at first, while outruns the Euler numbers, and then grow, once the factorial takes over.
The figure shows what that means in practice for small . After two terms of Leibniz’s series, using the expansion improves the estimate of the error for three terms and then makes it worse; after ten terms, the best is reached after sixteen terms of the expansion, at an error of about , and beyond that the corrections grow. The best point moves out roughly as , and the smallest error it reaches is about — the factor that comes from the poles of at distance , felt through .
So the expansion is asymptotic: for each fixed number of its terms, the error of using them falls faster than the next power of as grows, but for each fixed there is a limit to how well it can do. With the limit is around , so far away that the divergence is invisible in any number of decimals anyone will print. That is why the first figure looks as if it converges: its is large enough that the turning point is a million terms out.
The same accident for ln 2
The argument used nothing particular to except the integral representation, and the same calculation works for the series . After terms, with even, its tail is , and is . The hyperbolic tangent’s Taylor coefficients are, up to powers of 2 and factorials, the tangent numbers 1, 2, 16, 272, 7,936, which count the alternating permutations of odd length as the Euler numbers count those of even length. So the error is , with only even powers after the first.
The figure sums the first 500,000 terms exactly and compares the result with . With the terms of the error are , , , and , and the wrong digits fall at decimals 6, 11 and 12, 24, 35 and 36, 46 to 48, and near the sixtieth. Twelve of sixty are wrong, and the tangent numbers are visible in the shaded clusters exactly as the Euler numbers were in Leibniz’s series. The check in the figure is that five terms of the expansion account for the difference to forty-five decimals.
The two series sit together in the theory of alternating permutations. André’s theorem says that the up-down arrangements of objects are counted by the coefficients of : the secant for even , the tangent for odd. Here the secant governs the error of the series for , and the tangent the error of the series for . The genuinely surprising connection is that an estimate of how wrong two slow series are, read off in decimal, is a table of how many ways there are to arrange numbers in a zigzag.
Why the number of terms has to be round
Nothing in the expansion depends on being a power of ten. What depends on it is whether the error is easy to see in decimal. The figure computes the partial sum for seven values of and shades every one of the first fifty decimals that disagrees with . With 5,000,000, 500,000 and 50,000 terms, so that is , or , the error’s terms are whole numbers times powers of ten and 44, 43 and 40 of the fifty digits are right.
With 400,000 and 625,000 terms, is or . The terms are still finite decimals, because has no prime factors but 2 and 5, but they are long ones — runs to many digits — and the clusters of wrong digits spread and overlap. Twenty and thirty-one of fifty are right. With 314,159 and 271,828 terms, has other prime factors, every term of the error is an infinite decimal, and the same tiny error smears across every place: after the first five or six decimals, the partial sum agrees with only where a digit matches by chance, about one place in ten.
So the partial sum after 314,159 terms is not a worse approximation to than the one after 500,000 in any meaningful sense; it is a little worse, as the extra terms predict, and its error has exactly the same structure. It is only harder to read. A half-million is a lens: it lines up the error’s expansion with the decimal system, so that each term occupies its own block of digits.
What sixty digits cannot establish
The figures are exact computations, and they show the expansion holding to every order checked and for every tried. The proof that it holds for every and every order is the integral argument, which the figures illustrate but do not carry out. In particular, the first figure’s seventy-decimal agreement is a check on six terms at one value of ; the asymptotic statement — that the error after terms of the expansion is of the order of the next term, for every — is Watson’s lemma applied to , not something sixty digits can establish.
The figures also cannot make the series useful. Seeing the error’s structure suggests subtracting the first few terms of the expansion from the partial sum, and that does give a vastly better estimate of from 500,000 terms — but it is a form of acceleration, and the methods measured in turning a slow series geometric do the same job far more cheaply, from forty terms rather than half a million. The digit pattern is a curiosity about how a slow series is wrong, not a way to make it fast.
And the choice of base matters to the picture and to nothing else. In base 2, the clusters would appear for a power of 2; in base 12 for with a power of 12. A reader who works in decimal sees the Euler numbers at because of the base, and the Euler numbers are there at every whatever the base.
Still open: what kind of number the corrected sum is
The expansion raises a natural question about the numbers it produces. The partial sums are rational, and the corrections are rational, so subtracting any finite number of them from gives a rational approximation to of a very particular shape. How good can such approximations be, as a function of their denominators? For fixed the best is limited by the divergence, near , while the denominators grow like the least common multiple of the odd numbers up to , about ; whether combinations of partial sums and corrections can be found that approximate unusually well relative to their size — the kind of question behind proofs of irrationality — is not settled by anything here.
A second question concerns which other series show the same effect so cleanly. Any alternating series whose is a Laplace transform has an error expansion governed by the Taylor coefficients of a hyperbolic function, and the Borweins and Dilcher worked out several examples. For series that are not alternating, such as , the expansion involves Bernoulli numbers, whose fractions , , are not finite decimals, so no round lines them up into blocks; for series whose terms are not smooth in — sums over primes, say — no such expansion exists, and the digits of a partial sum are as ragged as they look. Exactly which series have a “digit lens” at round , and how many decimals it can align, is a question that has been explored case by case rather than answered.
Ten wrong digits in sixty
After 500,000 terms Leibniz’s series gives 3.14159065358979324046…, wrong at decimals 6, 17, 18, 29, 40–42 and 51–53 of the first sixty and right everywhere else. The tail of the series is , so its error is with the Euler numbers 1, −1, 5, −61, 1,385 from the secant — confirmed term by term for to 400, and to seventy decimals at , where puts each term in its own block of digits. The expansion diverges, with a best error near ; the series for does the same with the tangent numbers; and at a ragged like 314,159 the identical structure smears across every decimal. The series is as slow as ever. Its error is a table of zigzags.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- A series that waits on π — both name partial sum, pi
- A table that never reaches π — both name convergence rate, pi
- Getting pi by dropping needles on the floor — both name convergence rate, pi
- Pinned between two sequences — both name convergence rate, pi
- The error that predicts itself — both name convergence rate, pi
Named objects
A dashed tag is an object no other essay names yet.
Alternating seriesAsymptotic expansionConvergence rateEuler numberLaplace transformPartial sumPi