How many digits does $C(n)$ have?

801 Views Asked by At

Here :

Are there prime numbers $C(n)$ or $RC(n)$?

I defined the "crazy-numbers" and the "reversed-crazy-numbers". The number of digits of $C(n)$ is the same as the number of digits of $RC(n)$.

But how many digits does $C(n)$ have ? Is there a general formula ?

For $1\le n\le 9$, $C(n)$ has $$\frac{n(n+1)}{2}=\binom{n+1}{2}$$ digits. This is easy because the number of digits is just $1+\cdots+n$

For $10\le n\le 99$, $C(n)$ has $$n(n+1)-45$$ digits. This time the number of digits is $45$ (number of digits of $C(9)$) plus $2(10+\cdots+n)$, so we have $n(n+1)-9\cdot 10+45=n(n+1)-45$

For $100\le n\le 999$ , $C(n)$ has $$9855+3\cdot(100+\cdots +n)$$

digits. A pattern apparantly emerges , but I have no idea how I can find a universal formula for every $n$, if there actually is one.

1

There are 1 best solutions below

5
On

I finally figured out a formula : If $s$ is the number of digits of $n$, the number $c(n)$ has $$\frac{99n(n+1)s-(10^s-10)(10^s-1)}{198}$$ digits. With the help of mathworld I determined the formula $$c(10^n-1)=\frac{(10^n-1)(99\cdot 10^nn-10^n+10)}{198}$$ and the rest was relatively easy.