I need a function such that if input is $n$ it outputs an $n$-digit number. I need a mathematical function.
For example:
$$\begin{align}\mathrm{ANY}(2) &= 22 \\ \mathrm{ANY}(3) &= 333 \\ \mathrm{ANY}(n) &= nnn\ldots n \quad (n \text{ times})\end{align}$$
I think $\mathrm{ANY}(n)$ is something like:
$$\begin{align}\mathrm{ANY}(2) &= (10^1 + 10^2) * 2 \\ \mathrm{ANY}(3) &= (10^1 + 10^2 + 10^3) * 3 \\ \mathrm{ANY}(n) &= (10^1 + 10^2 + \ldots + 10^n) * n\end{align}$$
My question is can we further simplify the equation: $10^1 + 10^2 + \ldots + 10^n$? Or is it not possible?
Additionally, I need just any $n$-digit number on $n$ input, not necessary like $22$, $333$, $4444$, $\ldots$. In case simplification is not possible then suggest me any other function? I have no much idea if its possible.
Also domain to my $\mathrm{ANY}$ function can be $1$ to $100$.
I need to solve some problem in computer science.
ndigit number don't bothers if it11111 11111 1or22222 22222 2– Grijesh Chauhan Mar 28 '13 at 19:34