## There are more numbers that contain digit 9 than numbers that do not contain digit 9

Remember from the last post that the sum of inverses of all strictly positive integers converges to infinity:

$S_1 = \displaystyle\lim_{n \to \infty}\displaystyle\sum_{i=1}^{n}\frac{1}{i} = \infty$

I also proved that the sum of inverses of all strictly positive integers that don’t contain the digit 9 is finite. Denote this sum $S_2$.

Let $S_3$ be the sum of all strictly positive integers that contain the digit 9:

$S_3=\frac{1}{ 9}+\frac{1}{ 19}+\frac{1}{ 29}+\cdots+\frac{1}{ 90}+\cdots+\frac{1}{ 99}+\frac{1}{ 109}+\cdots$

Then:

$S_1 = S_2 + S_3$

Thus $S_3 = S_1 - S_2$, and it follows that $S_3=\infty$ because $S_1=\infty$ and $S_2$ is finite.

In words: the sum of inverses of strictly positive integers that don’t contain digit 9 is finite and the sum of inverses of strictly positive integers that contain digit 9 is infinity.

﻿

This may be counterintuitive because apparently there are more numbers that don’t contain digit 9 than numbers that contain digit 9, but this is not actually true.

There are $9^n-1$ strictly positive integers up to $n$ digits that don’t contain digit 9 (see here). And obviously the total number of strictly positive integers is $10^n-1$. This means that the number of strictly positive integers that contain digit 9 is: $10^n-9^n$. And here’s the trick, for n large enough:  $10^n-9^n>9^n-1$.

Let’s plot $10^n-2 \cdot 9^n$. You can see that for $n=7$(horizontal axis) $10^n-9^n$  is much bigger than $9^n-1$.