I'm having a bit of trouble understanding the probability of getting a number n when rolling multiple dice. When rolling $2$ dice, I noticed that the probability of getting the numbers $2-12$ goes like this:
$1/36, 2/36, 3/36, 4/36, 5/36, 6/36, 5/36, 4/36, 3/36, 2/36, 1/36$
Makes sense to me. However for $3$ dice, the pattern seems to be different, for values $3-18$.
$1/216, 3/216, 6/216, 10/216, 15/216, 21/216, 25/216, 27/216, 27/216, 25/216, 21/216, 15/216, 10/216, 6/216, 3/216, 1/216.$
Initially I thought it was just increasing by $1/216$, then $2/16$, then $3/216$, and so on but then when trying to get the value $9$ it becomes $25/216$ instead of $28/216$, breaking the pattern. So is there a mathematical sequence happening here, and if so what is it, I can't seem to find the formula online. I know that these probabilities can be calculated by getting the different permutations, but I want to know if there's a general formula for getting the probability of getting a value $x$ with $3$ dice, or even y amount of dice.
Assume we throw $k$ fair dice, each having $m$ faces, numbered from $1$ to $m$. As any possible ordered $k$-tuple is equiprobable the problem is essentially equivalent to finding the number of positive solutions to the equation: $$ x_1+x_2+\cdots x_k=n,\quad\text{with}\quad 1\le x_i\le m. $$
The problem is well-known and its solution is: $$ N(n,k,m)=\sum_{j\ge0}(-1)^j\binom kj\binom{n-1-m j}{k-1},\tag1 $$ with the convention $\binom pq=0$ if $p<q$.
Dividing $N(n,k,m)$ by $m^k$ you will obtain the probability of getting the total sum $n$.