Suppose I have following equation:
$$ a_1 + a_2+\cdots+a_k=n$$ $$a_1,a_2,\cdots,a_k\in\{m,m+1,m+2,\cdots,m+l \}$$ and $$m*k<n$$
I am asked to calculate how many different solution that equation has. What I came up with is changing variables: $a_i=a_i'+m$ and then my equation looks like this: $$ a_1' + a_2'+\cdots+a_k'=n-k*m$$ $$a_1',a_2',\cdots,a_k'\in\{0,1,2,\cdots,l \}$$ It may seem a little nicer to solve but still there's that $l$ limitation which I am not so sure know what to do with. Is there any "general" method to do this type of task? I already tried substituting one of variables like that: $a_i'=a_i''+l+1$ and then solving "smaller" equation but it just doesn't feel like the right way to do this.
My original equation is: $$a+b+c+d=45$$ $$a,b,c,d\in\{5,6,\cdots,15\}$$
I'll be thankful for any help or tips.