Suppose we are given $k$ ordered blanks (e.g. a length $k$ word) and $n$ types of objects. Also we have $k>n$. Now we want to fill in these blanks with these objects so that we at least use one object of each kind. In how many ways can we fill these blanks?
The following are my thought: clearly there would be repetitions as the number of blanks is larger than the number of types of objects. I could figure out some cases when plug in certain numbers for $n$ and $k$. But is there a general formula for this?