I need an algorithm to calculate the number of ways of expressing a number N as sum of numbers inside the interval [a, b]
1 Answer
What you want is the number of integer partitions restricted to the interval $[a,b]$. I suggest you take a look at the approaches to count all partitions (check references and external links of the article) and adapt it to your needs.