Ordering Balls of $N$ Types Given $a_n$ balls of type $n$ (for each $n$ between $1$ and $N$) how many ways of ordering them into an array of length $\sum_n a_n$ given that balls of the same type are indistinguishable?
(Edit: some of the $a_n$'s may be null). 

This is a multiset permutation; the possible ordering options are: $$\frac{\left( \sum_n a_n \right)!}{\prod_n{a_n!}}$$
And note that $0!=1!=1$, so if all elements are unique this works back to $\left(\sum_n a_n\right)!$ as expected.
