# Sum of harmonic series without 9s

Yesterday, I stumbled across the following question:

Does the following sum converge if you exclude all terms that don't include a $9$?

$\sum_{n=1}^{\infty}\frac{1}{n}.$

A little dash of anthropic reasoning suggests yes. Why would anyone have written the question on a poster and fixed it to the wall if otherwise? The base rate for chaotic trolls who also like math puzzles seems pretty low.

Fortunately, we can do better than anthropic reasoning, and, after thinking about it for a bit with Matt MacDermott, we found the answer:

First, let's rewrite the sum as

$S = \sum_{n=1}^{\infty} \frac{1}{n} I_n,$

where $I_n$ is an indicator function,

$I_{n}= \begin{cases} 1 & \text{if }9\text{ is a digit of }n,\\ 0 & \text{otherwise.} \\ \end{cases}$

The trick is to convert this sum over numbers into a sum over numbers of digits, then find an upper bound:

$\sum_{n=1}^{\infty}\frac{1}{n} I_{n}= \sum_{d=0}^{\infty} \sum\limits_{n'=10^{d}}^{10^{d+1}}\frac{1}{n'} I_{n'} < \sum_{d=0}^{\infty} \sum\limits_{n'=10^{d}}^{10^{d+1}} \frac{1}{10^{d}}I_{n'} = \sum_{d=0}^{\infty} \frac{1}{10^{d}} N_d,$

where $N_{d}$ is the number of numbers with $d$ digits that don't contain $9$, which we can compute by straightforward combinatorics,

$N_d=\sum\limits_{n'=10^{d}}^{10^{d+1}} I_{n'} = 8 \times 9^{d-1}.$

So we end up with a new infinite sum for an upper bound to our original sum:

$\sum\limits_{n=1}^{\infty} \frac{1}{n} I_{n} < \sum\limits_{d=0}^{\infty} \frac{8 \times 9^{d-1}}{10^{d} }<\sum\limits_{d=0}^{\infty} \left(\frac{9}{10}\right)^{d}= \frac{1}{1-\frac{9}{10}} = 10,$

which converges.