How many different combinations of a six sided die rolls equals n Say I want to roll a six-sided-die until all the rolls I have made added together equal X (for example a number like 812). How do I calculate how many different possible combinations of dice rolls add up to X?
for example:
say I want to find the different roll combinations that equal 6:
6
51
15
42
24
33
123
312
213
114
411
141
1113
3111
1311
1131
11112
21111
12111
11211
11121
and so on...
I have found that this approach does not work for larger numbers. Thanks
Thanks
 A: Instead of the clunky generating function approach I mentioned in the comments above, a stronger tool to use for this specific problem is recurrence relations.
Let $a_n$ represent the number of compositions of the number $n$ using only the numbers $1,2,\dots,6$
As the upper bound condition doesn't come into play for $n\leq 6$ these numbers when $n\leq 6$ (not when $n>6$) are the same as the number of ordinary compositions, i.e. $a_1=1, a_2=2, a_3=4, a_4=8, a_5=16, a_6=32$
For $n\geq 7$ any partition of $n$ into parts none of which exceeding $6$ will either end with a $1$, end with a $2$, ..., or end with a $6$.  There are exactly $a_{n-1},a_{n-2},\dots,a_{n-6}$ of each of these such compositions respectively.
We have then the recurrence relation
$$a_n = a_{n-1}+a_{n-2}+\dots+a_{n-6}$$
Similar to the fibonacci numbers, these are what some people call the Hexanacci Numbers
$\begin{array}{rl}a_1&=1\\ a_2&=2\\a_3&=4\\a_4&=8\\a_5&=16\\a_6&=32\\\hline\end{array}$
$\begin{array}{lrl}a_7&=a_6+a_5+a_4+a_3+a_2+a_1&=32+16+8+4+2+1&=63\\a_8&=a_7+a_6+a_5+a_4+a_3+a_2&=63+32+16+8+4+2&=125\\a_9&=a_8+a_7+a_6+a_5+a_4+a_3&=125+63+32+16+8+4&=248\\ \vdots\\
a_n&=a_{n-1}+a_{n-2}+a_{n-3}+a_{n-4}+a_{n-5}+a_{n-6}\end{array}$
