Probability that the sum of $k$ dice is $n$
The probability of two dice summing to k is simple enough, make a diagram of the throws,
$$ \begin{array}{c} &|&1&2&3&4&5&6\\\hline 1&|&2&3&4&5&6&7\\ 2&|&3&4&5&6&7&8\\ 3&|&4&5&6&7&8&9\\ 4&|&5&6&7&8&9&\color{green}{10}\\ 5&|&6&7&8&9&\color{green}{10}&11\\ 6&|&7&8&9&\color{green}{10}&11&12\\ \end{array} $$
and the probability of a sum is just the length of the corresponding diagonal divided by $36$. For instance, $\mathrm{P}(\mathrm{sum} = 10) = \frac{3}{36} = \frac{1}{12}$. However, it's not as easy to draw a diagram for three dice or more, so how would a general formula look?
Solution 1:
Following the notation and steps of this previous answer: let $n$ dice of $D$ sides each one numbered from $1$ to $D$, then we can represent the throw of these dice as
$$\begin{align}f(x)&=(x^1+x^2+\ldots+x^D)^n=\left(x\sum_{k=0}^{D-1} x^k\right)^n=\left(x\frac{1-x^D}{1-x}\right)^n\\&=x^n\sum_{k=0}^n(-1)^k\binom{n}{k}x^{kD}\sum_{j=0}^\infty\binom{n+j-1}{n-1}x^j\tag{1}\end{align}$$
Now we want to find a formula for the coefficient of the monomial $x^S$ in the expansion of $f$, denoted by $[x^S]f(x)$. This coefficient represent the different ways that the sides of the $n$ thrown dice add up to $S$. From $(1)$ we can see that $S$ will have the form $S=n+kD+j$, thus
$$\bbox[5px,border:2px solid gold]{[x^S]f(x)=\sum_{k=0}^M(-1)^k\binom{n}{k}\binom{S-kD-1}{n-1},\quad M:=\left\lfloor \frac{S-n}{D}\right\rfloor}\tag2$$
The details of the algebraic manipulations to achieve the formula stated in $\rm (2)$ are in the answer previously linked. I dont know if this formula can be simplified further in an useful way.
Finally note that because the dice are fair then each side of each dice have the same probability to show up, so $$ P(\operatorname{sum}=S)=\frac{[x^S]f(x)}{D^n}\tag3 $$