Number of permutations with repeated objects. I will use letters as objects. In general, suppose we have objects $\underbrace{X_1, \dotsc, X_1}_{n_1}, \underbrace{X_2, \dotsc, X_2}_{n_2}, \dotsc,\dotsc, \dotsc, \underbrace{X_k, \dotsc, X_k}_{n_k}$. Then what is the number of ways we can choose and order $N$ objects $0 \leq N \leq n_1 +\dotsb + n_k$, i.e. the number of permutations? If $n_1 = \dotsb = n_k = 1$, then of course this is just a standard permutation problem. I am just curious if there is a formula for it.
Note: I initially asked about combinations, which was pointed out to be a duplicate of the question here. I have deleted the original post to ask this question, instead.
 A: Let $m_i$ be the number of objects of type $i$ that were picked. Then $0\le m_i \le n_i$ and $\sum_{i=1}^k m_i = N$.   For a given set $\{m_i\}$, there are $ N!/\prod (m_i!)$ permutations.
Hence the count is given by
$$  \sum_{ m_1,m2 \cdots m_k }  \frac{N!}{\prod m_i!} $$
Where the sum is restricted to $0\le m_i \le n_i$ and $\sum m_i=N$.
That is:
$$  N ! \sum_{m_1=0}^{\min(N,n_1)} \frac{1}{m_1!} \sum_{m_2=0}^{\min(N-m_1,n_2)} \frac{1}{m_2!} \cdots \sum_{m_{k-1}=0}^{\min(N-m_1-m_2-\cdots,n_{k-1})} \frac{1}{m_{k-1}!}
\frac{[N-(m_1+m_2 + \cdots +m_{k-1})\le n_k]}{(N-(m_1+m_2 + \cdots +m_{k-1}))!} $$
A: Consider the recurrence where $n$ is the number of elements to choose, $k$ is the class that we are considering and $f(n,k)$ means the number of ways of take $n$ elements with elements of the classes $1,2,...,k$
$$f(n,k)=\sum\limits_{i=0}^{min(n,n_{k})}{ \frac{1}{i!} f(n-i,k-1)}, \space\space\space\space k>0$$
$$f(0,0)=1$$
$$f(n,0)=0,\space\space\space\space n>0.$$
We know that if we have $n$ letters and there are $k$ subclasses where each class have $n_j$ letters $L_j$  with $n_1+...+n_k=n$, then the number of all possible permutations is
$$\frac{n!}{n_1!...n_k!} \space\space\space\space(1)$$
because each $n_j$ letters $L_j$ are indistinguishable.
Now there are $n_1+...+n_k$ letters in total and first we want to choose $n$ of them without permute them, then for each class $k$ we will take $i=0$, or $i=1$,..., or $i=n_k$. So we will add up each election which yields to $f(n,k)=\sum\limits_{i=0}^{min(n,n_{k})}{ f(n-i,k-1)}$. But we want to choose them permute them, so will use the formula $(1)$ and we obtain the above recurrence. Therefore the answer will be 
$$N!f(N,k).$$
