How many compositions does 40 have (with up to 5 addends), with each positive integer addend between 2 and 12? I was on Youtube and found a show called Monopoly Millionaires' Club. I thought it would be interesting to try to calculate the probability of winning the million dollars.
The contestant starts on the Go square, and if they reach the Go square again in less than 5 rolls of the pair of dice, they become a millionaire. Here are the givens:


*

*The rolls must sum to 40 to get back to Go (I counted on an image of a board)

*You are allowed at most 5 rolls (although we know it's impossible to get to 40 with 3 rolls, so the partition must be at least 4 in length and at most 5).

*Each addend in the partition must be at least 2 and at most 12.


I think if we could answer that question, we could get an approximate answer to the probability, but I am not sure how to do it; it's been some time I've done combinatorics, and I don't even know if I would have been able to do it to start with due to the restriction on the addends.
Could someone possibly please show me how I could do this? Possibly without using the exhahustive method, but by using generating functions? I'd also be interested in subtracting the possibilities that would land the contestant in jail, but it seems that we would have to phrase the question in terms of composition since order matters (if you get 12+12+6 you land in jail, but you don't if you get 6+12+8+12+2 since summing to 30 will get you to jail).
(For the record, I already graduated with my math degree and am no longer studying math. This is not homework.)
Thanks!
 A: It is convenient to use the coefficient of operator $[x^k]$ to denote the coefficient of $x^k$ in a series. This way we can write for instance
\begin{align*}
[x^k](1+x)^n=\binom{n}{k}
\end{align*}

Hint: Here is a starter which shows how to obtain the coefficient of $x^{40}$ in a generating function representing five rolls with two dice.
  \begin{align*}
\color{blue}{[x^{40}]}&\color{blue}{\left(x^2+x^3+\cdots+x^{12}\right)^5}\\
&=[x^{40}]x^{10}\left(1+x^2+\cdots x^{10}\right)^5\\
&=[x^{30}]\left(\frac{1-x^{11}}{1-x}\right)^5\tag{1}\\
&=[x^{30}]\left(1-5x^{11}+10x^{22}\right)\sum_{j=0}^\infty\binom{-5}{j}(-x)^j\tag{2}\\
&=\left([x^{30}]-5[x^{19}]+10[x^8]\right)\sum_{j=0}^\infty\binom{j+4}{4}x^j\tag{3}\\
&=\binom{34}{4}-5\binom{23}{4}+10\binom{12}{4}\tag{4}\\
&\,\,\color{blue}{=7\,051}
\end{align*}

Comment:


*

*In (1) we apply the rule $[x^{p-q}]A(x)=[x^p]x^qA(x)$ and we use the finite geometric series formula.

*In (2) we expand the numerator up to terms with powers less or equal $30$ since other terms do not contribute. We also use the binomial series expansion.

*In (3) we use the linearity of the coefficient of operator and apply the same rule as in (1).

*In (4) we select the coefficients of $x^j$ accordingly.
