How to find the $n$-th term of the series $1, 22, 333, 4444, 55555..........?$
Here the $i^{\text{th}}$ term is the concatenation of $i$ for $i$ times.
for ef $13$ the term = $13$ concatenated $13$ times = $13131313131313131313131313$
$\endgroup$ 13 Answers
$\begingroup$For a number of $n$ of $m$ digits, that quantity is $$n\cdot\sum_{k=0}^{n-1}10^{km}=n\cdot\frac {10^{mn}-1}{10^m-1}$$
The number of digits of $n$ is $m=\left\lfloor \log_{10}n\right\rfloor+1$, therefore $$a_n=n\cdot\frac{10^{\left(\left\lfloor \log_{10}n\right\rfloor+1\right)n}-1}{10^{\left\lfloor \log_{10}n\right\rfloor+1}-1}$$
$\endgroup$ $\begingroup$First, you need the number of digits of $n$, which is$$d_n = \lfloor \log_{10} n\rfloor + 1$$where $\lfloor x\rfloor$ denotes the largest integer not larger than $x$ (commonly known as the integer part of $x$ when $x$ is positive).
Now you need to multiply $n$ with the “lattice number“$$l_n = 10\ldots010\ldots010\ldots\ldots010\ldots1$$where there are $n$ one digits, and $d_n-1$ zero digits between two consecutive one digits. This is because multiplying this with $n$ replaces each $0\ldots01$ block with $n$, and the same with the initial $1$, so that we get $n$ repetitions of the number $n$.
Now if we define$$m_k = \underbrace{999\ldots999}_{k\text{ digits}}$$then we find that$$l_n = \frac{m_{n d_n}}{m_{d_n}}$$This is because the sequence of $n\cdot d_n$ nine digits can be seen as $n$ repetitions of the number made of $d_n$ nine digits, and then the same argument as before applies, except that now we solved for $l_n$ rather than $m_{n d_n}$.
Finally, we find that for $m_k$ there's a closed formula,$$m_k = 10^k-1$$because $10^k$ is a $1$ followed by $k$ zeroes, and subtracting $1$ then gives $k$ nines through borrows all the way to the initial $1$ of $10^k$.
Putting everything together, the numbers in your sequence are therefore$$a_n = n\cdot l_{d_n} = n\cdot \frac{m_{n d_n}}{m_{d_n}} = \frac{n(10^{n d_n}-1)}{10^{d_n-1}}$$and finally inserting $d_n$:$$a_n = \frac{n(10^{n(\lfloor \log_{10} n\rfloor + 1)}-1)}{10^{\lfloor \log_{10} n\rfloor + 1}-1}$$
$\endgroup$ 5 $\begingroup$Let $a \;=\; 1 + \lfloor\log_{10} n\rfloor \;\Rightarrow\; n$ has $a$ digits
Let $b \;=\; \sum_{i = 0}^{(a-1)} \,10^i.$
Then the $n^{\text{th}}$ term is $n \times b.$
Edit
As others have pointed out, my original posting (above) is wrong.
The correction should be
$b \;=\; \sum_{i = 0}^{(n-1)} \,10^{(a\times i)}.$