Use generating functions to see if something turns up.
Each variable gets represented by:
$$
1 + z^L + z^{L + 1} + \ldots + z^M
= 1 + z^L \frac{1 - z^{M - L + 1}}{1 - z}
$$
The full problem is then to get the coefficient of $z^n$:
$$
[z^n] \left(1 + z^L \frac{1 - z^{M - L + 1}}{1 - z} \right)^k
= [z^n] \left(\frac{1 - z + z^L - z^{M + 1}}{1 - z} \right)^k
$$
Doable by expanding the numerator using the multinomial theorem, and using that with the extended binomial theorem:
$$
(1 + u)^{-m}
= \sum_{r \ge 0} \binom{-m}{r} u^r
= \sum_{r \ge 0} (-1)^r \binom{r + m - 1}{m - 1} u^r
$$
where $m \in \mathbb{N}$, but the coefficients won't turn out nice.
In how many ways can we distribute $10$ indistinguishable balls to $4$ different boxes such that no box receives exactly three balls?
Your strategy is correct. However,
$$\binom{13}{10} - \binom{4}{1}\binom{9}{7} + \binom{4}{2}\binom{5}{4} - \binom{4}{3}\binom{1}{1} = 286 - 144 + 30 - 4 = 168$$
In how many ways can we distribute $10$ different balls to $4$ different boxes such that no box has exactly three balls?
What you have done so far is correct.
There are four ways to distribute each of the $10$ balls, so there are $4^{10}$ ways to distribute the balls without restriction.
From these, we must subtract those cases in which one or more of the boxes receives exactly three balls.
A box receives exactly three balls: There are four ways to select the box which receives exactly three balls, $\binom{10}{3}$ ways to select which three balls that box receives, and $3^7$ ways to distribute the remaining seven balls to the remaining three boxes. Thus, there are
$$\binom{4}{1}\binom{10}{3}3^7$$
such distributions.
Two boxes each receive exactly two balls: There are $\binom{4}{2}$ ways to select which two boxes receive exactly three balls, $\binom{10}{3}$ ways to select which three balls are placed in the leftmost of those boxes, $\binom{7}{3}$ ways to select which three of the remaining seven balls are placed in the other box which is selected to receive exactly three balls, and $2^4$ ways to distribute the remaining four balls to the remaining two boxes. Hence, there are
$$\binom{4}{2}\binom{10}{3}\binom{7}{3}2^4$$
such distributions.
Three boxes each receive exactly three balls: There are $\binom{4}{3}$ ways to select which three boxes receive exactly three balls, $\binom{10}{3}$ ways to select which three balls are placed in the leftmost of those boxes, $\binom{7}{3}$ ways to select three of the remaining seven balls is placed in the middle of those boxes, $\binom{4}{3}$ ways to select which three of the remaining four balls is placed in the rightmost of those boxes, and one way to place the remaining ball in the remaining box. Hence, there are
$$\binom{4}{3}\binom{10}{3}\binom{7}{3}\binom{4}{3}1^1$$
such distributions.
By the Inclusion-Exclusion Principle, the number of ways ten distinct balls can be distributed to four distinct boxes so that no box receives exactly three balls is
$$4^{10} - \binom{4}{1}\binom{10}{3}3^7 + \binom{4}{2}\binom{10}{3}\binom{7}{3}2^4 - \binom{4}{3}\binom{10}{3}\binom{7}{3}\binom{4}{3}1^1$$
Best Answer
Of course $n$ must be even. Then distribute $\frac{n}{2}$ balls over $k$ boxes (no conditions) and double the amounts in all boxes. This gives all such even distibutions and so the problem is equivalent to the $\frac{n}{2}$ over $k$ boxes problem for even $n$. For $n$ odd there are no solutions.