I want to calculate the multinomial coefficient:
where it is satisifed
Why not use this? It's fast and doesn't suffer from overflow:
N = prod([1:n]./[1:n0 1:n1 1:n2]);