# How to count number of positive solutions of an equation $x_1 + x_2 +…+ x_n = s$ where $0 < x_i \le c$. [duplicate]

• I want to solve the equation:
$$x_1 + x_2 +...+ x_n = s \\ \text{where }\ 0 < x_i \le c$$
• Or to rephrase the question count number of ways to break number $$s$$ in to $$n$$ numbers where each number is between $$1$$ to $$c$$.
• Without upper bound $$x_i < c$$ I can use stars and bars method. But since i have upper limit can i still use same method with some modification? Or can you reference me to some other method which can help me solve this.
• @Mike Earnest I read your answer in the link. Its really helpful. But i am not sure how the equation will change since i have $xi>0$ and in your answer its $xi≥0$. Just $n$ will be removed from top? – poojan124 Nov 1 at 15:56
• @poojan124 If you want $x_i \ge 1$, write $x_i = 1 + t_i$ and that becomes $t_i \ge 0$. – Robert Israel Nov 1 at 16:08
• Consider the generating expression that is the coefficient of $x^s$ in $(x+x^2+x^3\dots+x^c)^n$. – Certainly not a dog Nov 1 at 16:08