Count the number of ways n different-sided dice can add up to a given number I am trying to find a way to count the number of ways n different-sided dice can add up to a given number.
For example, 2 dice, 4- and 6-sided, can add up to 8 in 3 different ways: ($(2,6),(3,5),(4,4)$).
I've found a similar question but I cannot find a way to generalize it to my problem.
 A: I can't provide a nice formula as in your referenced question, but I can show you at least half of the way.
Let's start with your

Example: There are two dice with 4 and 6 sides. How many ways are there, so that rolling both dice once result in 8 pips?

We encode the dies with polynomials and use the exponents to label the pips

\begin{align*}
\text{4-sided die}&\qquad x^1+x^2+x^3+x^4\\
\text{6-sided die}&\qquad x^1+x^2+x^3+x^4+x^5+x^6
\end{align*}

If we denote with $[x^k]$ the coefficient $a_k$ of $x^k$ of a polynomial $\sum_{j=0}^{n}a_j x^j$, we observe
\begin{align*}
[x^8]&(x^1+x^2+x^3+x^4)(x^1+x^2+x^3+x^4+x^5+x^6)\\
&=[x^8]x\frac{1-x^4}{1-x}x\frac{1-x^6}{1-x}\\
&=[x^6](1-x^4)(1-x^6)\frac{1}{(1-x)^2}\\
&=[x^6](1-x^4-x^6+x^{10})\sum_{j\geq 0}\binom{-2}{j}(-x)^j\\
&=[x^6](1-x^4-x^6+x^{10})\sum_{j\geq 0}\binom{j+1}{j}x^j\tag{1}\\
&=([x^6]-[x^2]-[x^0])\sum_{j\geq 0}(j+1)x^j\\
&=7-3-1\\
&=3
\end{align*}
So, the result is $3$ in accordance with your example. Now the same generalized:

Generalisation: Let's assume there are $N$ dice with different sides. How many ways are there rolling $N$ dies once result in $K$ pips? Since we do not require pairwise different sides, we my assume $j_1$ dice with $k_1$ sides, $j_2$ dice with $k_2$ and finally $j_l$ dice with $k_l$ sides together with  $j_1+\dots+j_l=N$.

We can now calculate similarly to the special case above:
\begin{align*}
[x^K]&(x^1+\cdots+x^{k_1})^{j_1}\cdot...\cdot(x^1+\cdots+x^{k_l})^{j_l}\\
&=[x^K]x^{j_1}\left(\frac{1-x^{k_1}}{1-x}\right)^{j_1}\cdot...\cdot x^{j_l}\left(\frac{1-x^{k_l}}{1-x}\right)^{j_l}\\
&=[x^{K-j_1-...-j_l}](1-x^{k_1})^{j_1}\cdot...\cdot(1-x^{k_l})^{j_l}\frac{1}{(1-x)^N}\\
&=[x^{K-j_1-...-j_l}]\prod_{m=1}^{l}\left(1-x^{k_m}\right)^{j_m}\sum_{n\geq 0}\binom{-N}{n}(-x)^n\\
&=[x^{K-j_1-...-j_l}]\prod_{m=1}^{l}\left(1-x^{k_m}\right)^{j_m}\sum_{n\geq 0}\binom{N+n-1}{n}x^n\tag{2}\\
\end{align*}
Observe, that formula $(2)$ corresponds to formula $(1)$ in the special case above. So, for specific values we can continue at least in principle as we did from $(1)$.
