$N$ identical Balls to be placed in $P$ non-identical boxes with maximum $K$ in each box In how many ways can $N$ identical balls be put in $P$ non-identical boxes such that no box is left empty and all boxes contain less than or equal to $K$ balls.
I have worked out the following formula,
$${N-1 \choose P-1} -  P \times\sum_{i = P - 2}^{N - (K + 1)} {i \choose P - 2}$$
Also we have $P =  \lfloor N/K \rfloor + 1 $
Is there any simpler formula, any way to better its computationality?
 A: Let's call the the number of ways $f(N,P,K)$.  Then,  thinking about the final box, you have $$f(N,P,K) = \sum_{m=1}^K f(N-m,P-1,K)$$ starting with $f(0,0,K)=1$ and $f(N,0,K)=0$ when $N \not = 0$.  This is related to a generalised form of Pascal's triangle (slightly skewed)
So for example, if $K=3$, you would get a table which starts like this 
    P   0   1   2   3
N
0       1   0   0   0
1       0   1   0   0
2       0   1   1   0
3       0   1   2   1
4       0   0   3   3
5       0   0   2   6
6       0   0   1   7
7       0   0   0   6
8       0   0   0   3
9       0   0   0   1

and these are known as trinomial coefficients, with each value the sum of the three values immediately above in the previous column.  With $K=2$ there would be binomial coefficients, and with $K=4$ there would be quadrinomial coefficients, and so on for larger $K$ 
A: You could start by filling all the boxes and count ways to reduce the number of balls according to your rules.
I think the number $n$ of balls to reduce is between $1$ and $P$, and we should stars and bars is over $P$ boxes, with one special case where $n = P$, and we can't have all balls removed from 1 box in any of $P$ ways.
