Proving that this formula all over the positive integer gives us this sequence Firstly, we have this sequence : $1,1,1,1,1,1,1,1,1,1,2,2,2,...$ which is the sequence of the number of digits in decimal expansion of $n$.
Secondly, we have this formula : $$a_n=\Bigl\lceil\log_{10}(n+1)\Bigr\rceil-\Bigl\lceil\frac{n}{n+1}\Bigr\rceil+1$$ where $n\ge0$
This formula seems to gives us this sequence.
How to prove this ?

Firstly, for $n \ne 0$, $n$ has $d$ digits if and only if $10^{d - 1} \le n < 10^d$. One way to find $d$ from here is to take logarithms, using $d - 1 \le \log_{10}(n) < d$, so $d = \lfloor \log_{10}(n) \rfloor$.
However, this expression doesn't work so well when $n = 0$, so we have to be a bit creative. Adding $1$, we get $10^{d - 1} + 1 \le n + 1 < 10^d + 1$. But a strict inequality of natural numbers of the form $a < b + 1$ can be equivalently written as $a \le b$, so in fact we can write $10^{d - 1} < n + 1 \le 10^d$. Then $d - 1 < \log_{10}(n + 1) \le d$, so $d = \lceil \log_{10}(n + 1) \rceil$. This expression doesn't freak out quite so much when $n = 0$.
The last bit is just a clever trick so that $a_0 = 1$. If $n = 0$, then $n/(n + 1) = 0$, so $\lceil n/(n + 1) \rceil = 0$. Otherwise, $0 < n/(n + 1) < 1$, so $\lceil n/(n + 1) \rceil = 1$.
