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$\begingroup$ What for? What have you tried? Is there a target runtime? $\endgroup$– Raphael ♦Jun 8, 2012 at 12:17
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.