# An easily generated integer sequence

Find the next number in the following sequence. It is not purely mathematical but needs only an introduction to mathematics, as generally taught, to answer it and is not very convoluted.

5, 5, 4, 4, 4, 5, 4, 4, 4, 5, 3, 3, 5, 5, 5, 5, 4, 5, 5, ?

This sequence surely diverges to infinity, and although the values of higher terms than above depend on how the 'function' is exactly defined including personal style, I would be interested if something could be said on how the values of the sequence behave as n becomes large.

3

Because

For a natural number $n$, let $f(n)$ be the number of letters in the English spelling of $n$. Then the $n$th term in the above sequence is $f(f(n))$.

So, for example, to obtain the $8$th number in the sequence we count the number of letters in 'eight' which is five and then count the number of letters in 'five' which is four.

The next ($20$th) term is $f(f(20))$. The number of letters in 'twenty' is six and the number of letters in 'six' is three.

Behaviour as $n \rightarrow \infty$

I'm not sure of a good answer to this and I guess it depends on how you call higher powers of $10$ as your numbers increase but I guess that the point is we give names to every subsequent power of $10$.

To me, this seems to suggest that the general trend of $f$ will be approximately $k \log_{10} n$ where $k$ is some constant. So, the sequence above probably goes something like $\log(\log n)$?

• Thank you so much especially for the extra thought on the sequence as n→∞.
– Tom
Apr 25 '16 at 10:00
• Nice puzzle ! I think we can't say it has the same asymptotic behaviour as $log(logn)$ because it restarts to a small number every time we meet a new named number (if named numbers are infinite, I don't know ??? ) Apr 25 '16 at 12:03