I have 3 numbers
$M=10$
$N=5$
$I=2$
Suppose I have been given number $R$ as input that is equal to $40$
so in how many ways these $3$ numbers arrange them selves to reach $40$
e.g.
$$10+10+10+10$$
$$10+5+5+5+5+10$$
$$5+5+5+5+5+5+5+5$$
etc.
Kow can you give me formulae supposing I pass any number e.g. $30$ etc.
What are formulae to calculate the number of these $3$ integers combinations to given number?
1 MORE EXAMPLE?
suppose number is 7
combinationare 2 these are
5+2
2+5
Here is a slightly different way to calculate the number of compositions of $40$ generated from $2,5$ and $10$.
We are interested in the coefficient of $x^{40}$ and expand the series accordingly. It is convenient to use the coefficient of operator $[x^n]$ to denote the coefficient of $x^n$ of a series.
Comment:
In (1) we use the linearity of the coefficient of operator and the rule \begin{align*} [x^{n-m}]A(x)=[x^n]x^mA(x) \end{align*}
In (2) we use another notation for summation and respect that the power $40-2j-3k$ is non-negative. In order to get a coefficient with a contribution $>0$ we have to choose $40-2j-3k=5l$. This is done in the next step.