Skip to main content
4 of 5
edited body

Number of integer solutions of a linear equation under constraints

How many positive integer solutions of $$\sum_{i=1}^{k}x_i = N$$ for some positive integer $N$ given the constraints $n_i\leq x_i\leq m_i$ for $i=1,\ldots,k$, where $n_i$ and $m_i$ are positive integers.

I know that it can be calculated by finding the coefficient of $y^N$ in the polynomial $\prod_{i=1}^{K}(y^{n_i}+\cdots,y^{m_{i}})$. Is there any compact formula or any upper bound to the number of the positive integer solutions?