On Jimmy Salvatore’s awesome math blog, Dying Lovegrape, he considers the fun problem of finding the sum In the course of thinking about the problem, he finds some interesting methods for speeding up the addition process, but ultimately yearns for a closed form solution like a scurvied pirate for a lime tree. Here we present such a solution, which uses a trick we used in a past post on credit cards and amortization.
The first step is to look at the terms in the series, , etc. What we can notice is that any number in the sequence is just the previous number multiplied by 10 and added to 1. For instance, . Let’s turn this into an analytic expression by promoting the multiplier 10 to the variable . And, as an example, let’s say we want to calculate 4th term in the sequence in terms of . When we perform this algorithm, we are evaluating the expression
which, as we shown in the amortization post, expands to
which is a geometric series. This particular term is equal to and in general, the nth term is equal to .
So, this gives us a neat way of writing each term in the sequence, all of which we must now sum together.
I.e., if we end at the nth term, the sum is , we must find
We can write this analytically as
Of course, all of the 1′s in the sum just add up to , so the only thing left to do is to add up all of the terms , but we have already done this, and it is again a finite geometric series. The only trick we do is to pull a factor of in front of the sum so that we have the typical geometric series, i.e.
now, it is clear that upon evaluating the geometric series in the last expression that we will get
Now, if we plug in as it is in the original problem, we find that the sum of the first terms is given by the closed form expression . Below, we plot the function along with data points from summing the first 1, 2, 3, 11 and 13 terms on a calculator.
Finally, we evaluate the formal expression for values of from 1 to 30. As expected, they agree with the partial sums found by hand. The number in the left column corresponds to the number of terms and the number on the right is the sum of the terms.
I realized that the comparison of Jimmy and a scurvied pirate is all the more delightful, since at one point in his life (unless I am mistaken), he actually gave himself scurvy (in the 21st century no less) via his surreal infatuation with eating sauteed mushrooms, and evidently, little other than sauteed mushrooms for months on end. I love Jimmy more than I can really know.