Computing Kempner Sums

This notebook demonstrates the algorithm in the paper, "Summing a curious, slowly convergent series" by Thomas Schmelzer and Robert Baillie, in the American Mathematical Monthly, June/July, 2008, pages 525-540.

Initialization: read in the source code.

Mathematica will look for this .m file in the directories specified by $Path.  If the file is not in any of these directories, you must specify the full path and file name yourself.

<< kempnerSums.m

Some Basic Calculations

Compute the sum of 1/n where n has no digit 9 in base 10:

kSum[9]

Compute the sum of 1/n where n has no 09.  Because of the leading zero, Mathematica will interpret 09 as 9, so we must enclose 09 in quotes:

kSum["09"]

Compute, to 30 decimals, the sum of 1/n where n has none of the digits 3, 1, or 4:

kSum[{3, 1, 4},30]

Compute the sum of 1/n where n has no digit string 314:

kSum[314]

Now we will compute the partial sum of this last series over all n having at most 100 digits (that is, for n < 10^100).  Even though that's a huge number of terms, observe that this partial sum is still less than 1/10th as large as the sum of the entire series:

kPartialSum[100]

How far do we have to go in this series to make the partial sum exceed 1000?  The next calculation shows that we must include at least some terms with 569-digit denominators.  The sum of all terms with n  < 10^568 is about 998.796459, while the sum with n < 10^569 is about 1000.100104 :

kPartialSumThreshold[1000]

We can also do calculations in bases other than 10.  Here we compute, to 30 decimals, the sum of 1/n where n has no 0 in base 2.  This sum can be verified because it is equal to the rapidly-converging sum  (∑_(k=1)^∞)(1/((2^k) - 1)) = 1.6066951524... .

kSum[0, 30, 2]

Matrices Used in the Calculations

Given a set of missing digits, compute the T matrix:

kSumGetT[0] // MatrixForm

kSumGetT[{2,3,5,7}] // MatrixForm

kSumGetT[314] // MatrixForm

Given a set of missing digits (0 and 11), compute the A matrix:

kSumGetA[{0, 11}] // MatrixForm

If you have computed a T matrix yourself, you can use that matrix to compute the corresponding sum.  Here is an example from Section 6 of the paper:

tExample={{0,3,0,1,0,2,0,1,0,1},
{0,3,0,1,0,0,0,1,0,1},
{0,3,0,4,0,2,0,1,0,1},
{0,3,0,1,0,5,0,1,0,1},
{0,3,0,1,0,0,0,6,0,1},
{0,3,0,1,0,2,0,1,0,0}};

kSum[tExample]

Characteristic Polynomial and Eigenvalues of the A Matrix

Here are a string and its corresponding matrix A:

aMatrix = kSumGetA[314]; aMatrix // MatrixForm

Here are the Characteristic Polynomial of A and the Eigenvalues of A:

CharacteristicPolynomial[aMatrix,x]

N [Eigenvalues[aMatrix], 20]