The question is as follows:
In how many ways can $30$ balls be placed into $10$ bins. The restriction is that any bin can only contain $0$, $2$, $3$ or $5$ balls. The balls are identical and the bins are identical.
This formula can be used, but how can it be adjusted to account for the restrictions?
$$\binom{n - 1}{k - 1}$$
In addition the problem can be restated to this Diophantine equation with three variables:
$$2x_1 + 3x_2 + 5x_3 = 30$$
Edit:
Evaluating the coefficient of $x^{30}$ in the generating function $(1 + x^2)^{10}(1+x^3)^{10}(1+x^5)^{10}$ gives $5630506$ which does not make sense.
Let us first study the given equation, $2a+3b+5c=30$. I'm setting $x_1=a, x_2=b, x_3=c$. Taking modulo $2,3,5$ $$b\equiv c \mod 2 $$ $$ a+c \equiv 0 \mod 3$$ $$a \equiv b \mod 5$$
Meaning,
I made following table on two cases : $a$ is odd or even. First using $\# 1$ that $a,b$ give same remainder by $5$, I filled in as follows, \begin{array}{c|c|c|c|c|c|c} \hline a & b & c & & a & b & c \\ \hline 1 & 1 & & & 0 & 0 & \\ & 6 & & & & 5 & \\ & & & & & 10 & \\ \hline 3 & 3 & & & 2 & 2 & \\ & 8 & & & & 7 & \\ \hline 5 & 0 & & & 4 & 4 & \\ & 5 & & & & 9 & \\ & 10 & & & & & \\ \hline 7 & 2 & & & 6 & 1 & \\ & 7 & & & & 6 & \\ \hline 9 & 4 & & & 8 & 3 & \\ & 9 & & & & 8 & \\ \hline & & & & 10 & 0 & \\ & & & & & 5 & \\ & & & & & 10 & \\ \hline \end{array}
Using $2a+3b+5c=30$, fill in values of $c$. Many possibilities will be crossed out due to $\# 4$. $\# 2$, $\# 3$, will be automatically true. \begin{array}{c|c|c|c|c|c|c} \hline a & b & c & & a & b & c \\ \hline 1 & 1 & \quad 5 \quad \color{green}\checkmark & & 0 & 0 & \quad 6 \quad \color{green}\checkmark \\ & 6 & \quad 2 \quad \color{green}\checkmark & & & 5 & \quad 3 \quad \color{green}\checkmark \\ & & & & & 10 & \quad 0 \quad \color{green}\checkmark \\ \hline 3 & 3 & \quad 3 \quad \color{green}\checkmark & & 2 & 2 & \quad 4 \quad \color{green}\checkmark \\ & 8 & \color{red}\times & & & 7 & \quad 1 \quad \color{green}\checkmark \\ \hline 5 & 0 & \quad 4 \quad \color{green}\checkmark & & 4 & 4 & \quad 2 \quad \color{green}\checkmark \\ & 5 & \quad 1 \quad \color{red}\times & & & 9 & \color{red}\times \\ & 10 & \color{red}\times & & & & \\ \hline 7 & 2 & \quad 2 \quad \color{red}\times & & 6 & 1 & \quad 3 \quad \color{green}\checkmark \\ & 7 & \color{red}\times & & & 6 & \color{red}\times \\ \hline 9 & 4 & \color{red}\times & & 8 & 3 & \color{red}\times \\ & 9 & \color{red}\times & & & 8 & \color{red}\times \\ \hline & & & & 10 & 0 & \quad 2 \quad \color{red}\times \\ & & & & & 5 & \color{red}\times \\ & & & & & 10 & \color{red}\times \\ \hline \end{array}
There are $11$ valid solutions.