How many solutions to $x_1+x_2+x_3+x_4 = n$ with restriction $0\leq x_1 \leq x_2 \leq x_3 \leq x_4$.
I have seen this kind of questions with $x_i$ odd/even. Or each having a range like $l\leq x_i \leq r$ also $x_1+\cdots x_k < n$ and in many other formats. But I dont know how to cope with this. How to proceed?