Given a positive integer $n,$ let $S(n)$ be the number of digits in the decimal expansion of $n,$ and let $$f(n)=n\cdot S(n)\cdot S(S(n))\cdot\ldots$$ Note that this is well-defined, since repeatedly applying $S$ eventually yields a stable state at $1$. For example, $$f(99)=99\cdot 2\cdot 1\cdot1\cdot\ldots=198$$ and $$f\left(10^{100}\right)=10^{100}\cdot 101\cdot 3\cdot 1\cdot1\cdot\ldots=303\cdot 10^{100}.$$ Does the sum $\displaystyle\sum_{n=1}^{\infty}\frac{1}{f(n)}$ converge or diverge?

Some context: I'm trying to find the limits of what can be done with the integral test. The functions $\frac{1}{x},$ $\frac{1}{x\ln(x)},$ $\frac{1}{x\ln(x)\ln(\ln(x))},$ etc. have integrals of $\ln(x),$ $\ln(\ln(x)),$ $\ln(\ln(\ln(x)))$ etc. respectively, so infinite sums over these functions diverge ever more slowly as you add more terms; this is an attempt to find out what the limiting behavior looks like. Base 10 used for ease of reading, but the answer in any base should be the same since sums are off by at most a constant factor.


1 Answer 1


It diverges, but excruciatingly slowly. Consider the sequence $t_0 = 1, t_{k+1} = 10^{t_k}$ of tetrations of $10$ and consider grouping up the partial sums via the intervals $[t_k, t_{k+1})$ as

$$s_k = \sum_{n=t_k}^{t_{k+1} - 1} \frac{1}{f(n)}$$

so that the original sum is $\sum_{k=0}^{\infty} s_k$. Now, we have $f(n) = n f(S(n))$, and as $n$ ranges over the interval $[t_k, t_{k+1})$, $S(n)$ ranges over the interval $[t_{k-1}, t_k)$. So we can further break up the sum $s_k$ by the value of $S(n)$, getting (for $k \ge 1$)

$$s_k = \sum_{n=t_k}^{t_{k+1}-1} \frac{1}{n f(S(n))} = \sum_{m=t_{k-1}}^{t_k-1} \frac{1}{f(m)} \sum_{S(n)=m} \frac{1}{n}.$$

For the inner sum we have the usual estimate

$$\sum_{S(n)=m} \frac{1}{n} = \sum_{n=10^m}^{10^{m+1}-1} \frac{1}{n} \ge \ln \frac{10^{m+1}}{10^m} = \ln 10$$

which gives

$$s_k \ge s_{k-1} \ln 10$$

so $\sum_{=0}^{\infty} s_k$ diverges but the divergence (of the original sequence of partial sums) happens roughly as slowly as inverse tetration.

  • 2
    $\begingroup$ Interestingly this argument does not work if the base is changed to $2$, because in that case $\ln 2 < 1$, although it works for all bases $\ge 3$. I think it should still diverge in base $2$ but who knows? It's also not entirely clear what happens in "base $e$," that is, if we replace $S(n)$ by $\text{min}(1, \lfloor \ln n \rfloor)$. $\endgroup$ Oct 4 at 18:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .