Consider the following problem. I have $n$ placeholders. On each placeholder, I can place a number from $1$ to $9$. Now there are $9^n$ possible ways to fill the places, but I am only interested in the number of ways of sorted placements, i.e. for $n=3$, I would like to have
1,1,1
1,1,2 # but neither 2,1,1 nor 1,2,1
1,1,3 # but neither 3,1,1, nor 1,3,1
...
From brute force I know that for $n=3$ the number of placements is $165$, and for $n=4$ it is $495$ and for $n=5$ it is $1287$. But I wish to compute the number of placements for $n=50$.
Is there a mathematical notion for this kind of procedure?
With $n$ placeholders and $k$ numbers to put in there in ordered fashion (for you, $k=9$), the answer is
$$ \binom{n+k-1}{n} $$ To provide some intuition to the answer, and as an interesting aside, if you have a block pyramid of dimension $n$ and with $k$ blocks along an edge, then the answer to your question is also the number of blocks in the pyramid. The pyramid below has dimension $n=3$ and blocks along an edge $k=15$.