Count the number of group of possitive variables of equation $x_1+x_2+...+x_k=n$ $\forall$ $1\le x_i\le m$, $1 \le i \le k$
For examples:
$x_1+x_2+x_3=5$ $\forall$ $ x\le 2$ the answer is 3 because we have 3 groups $(1,2,2), (2,1,2), (2,2,1)$
$x_1+x_2+x_3+x_4=10$ $\forall$ $ x\le 4$ the answer is $4!+\frac{4!}{2!*2!}+\frac{4!}{3!}=34$ because we have permutation of groups $(1,2,3,4), (4,4,1,1), (3,3,3,1)$
I have no idea to solve the condition of the equation. I have tried to use opposite event for all variables like: $x \le 2$ change to $x \geq 3$ then set $y=x-3$ change equation to $y_1+y-2+...+y_k=n-3*k$ at both side of equation but it does not true
Any help would be appreciated
Hint:
The coefficient of $y^{n}$ from
$$ \left(\sum_{j=1}^{m}{y^{j}}\right)^{k} $$
Another approach will be inclusion - exclusion.
$$ \sum_{j=0}^{\left\lfloor\frac{n-k}{m}\right\rfloor}{\binom{k}{j}\binom{n-1-jm}{k-1}\left(-1\right)^{j}} $$
Basically calculating all positive integer solutions and then substracting the number of solutions which have any $x_{i}>m$