Monomials with degree $k$ of the following polynomial $(1+_1+⋯+_1^{q}+y_1+⋯+y_1^{d})^{n}$ Let be $q,n,d$, I want to know, for any $k\in \mathbb{N}$, the number of monomials with degree  of the following polynomial:
$(1+_1+⋯+_1^{q}+y_1+⋯+y_1^{d})⋅(1+_2+⋯+_2^{q}+y_2+⋯+y_2^{d})\cdot… \cdot(1+_n+⋯+_n^{q}+y_n+⋯+y_n^{d})$
Do you know any idea to help me to count it?
 A: First, notice that when you unfold the product then you are choosing some of them to be $x_i$ and the others to be $y_j$. Lets say that you choose $s$ $x_i$ in $\binom{n}{s}$ ways. Lets say further that the sum of the degrees of those is $s',$ then the sum of the degrees of the $y_j$ is $k-s',$ call it $t'$ and call $t$ the number of $y_j's$. We want $t+s=n$ and $t'+s'=k.$
Move $s$ and $s'$ as you wish as
$$\sum _{s=0}^n\binom{n}{s}\sum _{s'=0}^k(\text{# ways $x_i$ add to s'})\cdot (\text{# ways $y_j$ add to k-s'}),$$
using stars and bars(and inclusion-exclusion), we know that the number of tuples adding to $s'$ with parts less or equal than $q$ is $$\sum _{r=0}^s(-1)^r\binom{s}{r}\binom{s'-(q+1)r+s-1}{s-1},$$
similarly for the $y_j$ notice that we are not allowing $0$ as a part (I took $1=x_i^0$) and we have
$$\sum _{\ell =0}^{n-s}(-1)^{\ell}\binom{n-s}{\ell}\binom{k-s'-d\ell-1}{n-s-1}.$$
Plugging all together, we get
$$\sum _{s=0}^n\sum _{s'=0}^k\sum _{r=0}^s\sum _{\ell =0}^{n-s}(-1)^{r+\ell}\binom{n}{s}\binom{s}{r}\binom{s'-(q+1)r+s-1}{s-1}\binom{n-s}{\ell}\binom{k-s'-d\ell-1}{n-s-1}$$
Not entirely sure if this sum simplifies.
A: This Combinatorics. Use of multisets? should help you. Let's start with $(1+x+...+x^q)^n$. You can think of your problem as you have $k$ stars and $n-1$ dividers. You now want to know how many possibilities are there to distribute those $k+n-1$ objects.
An example for $k=2,n=4$: *||*| would represent x * 1 * x * 1 and ||**| would represent 1 * 1 * x^2 * 1
However, you need to take into account that this only works for $q \geq k$. Otherwise you have to subtract all possibilities where you would assign more than $q$ stars to one factor, example:
$q = 2, k = 3, n = 4$: In our representation above, ***||| representing x^3 * 1 * 1 * 1 would work as well, but in this case we are restricted by $q=2$ so $x^3$ is not possible.
You can then look at $(1+x+...+x^q + y +...+y^p)^n$ as $((1+x+...+x^q) + y+ ...+y^p)^n$ considering that you already know the amount of possibilities for $(1+x+...+x^q)$ to have degree $j$.
This answer is not complete, but it was too much to write it just into a comment.
Do you have any constraints for $q,p,k,n$?
A: Let
$$a=\min(d,q),\quad b=\max(d,q),\quad s_i = x^i+y^i,\qquad (i=1\dots a),\tag1$$
$$z_j=
\begin{cases}
x^j,\quad\text{if}\quad q>d\\
y^j,\quad\text{if}\quad q<d,
\end{cases}
\qquad (j=a+1\dots b).\tag2$$
Then the given polynomial can be written in the form of
$$P=(1+s_1+s_2+\dots s_a+z_{a+1}+z_{a+2}+\dots+z_b)^n.\tag3$$
In accordance with the multinomial formulas,
$$P=\sum_{\large\substack{u_0+u_1+\dots+u_a\\+v_{a+1}+\dots+v_b=n}}\;n!\;\dfrac{1^{u_0}s_1^{u_1}\dots s_a^{u_a}z_{a+1}^{v_{a+1}}\dots z_b^{v_b}}{ u_0!u_1!\dots u_a!v_{a+1}!\dots v_b!},\tag4$$
wherein $\;s_i^{u_i}\;$ contains $\,2^{u_i}\,$ terms of the degree $\,iu_i\,$ and  $\;z_j^{v_j}\;$ contains one term with the degree $\,jv_j.$
If to choose in the formulas $(5)$ only terms of the order $\,k\,$ and to take in account the multiplicity, then easily to get the required quantity of tags in the form of
$$T_k=\sum_{\large\substack{u_0+u_1+\dots+u_a\\+v_{a+1}+\dots+v_b=n,\\
u_1+2u_2+\dots+au_a\\+(a+1)v_{a+1}+\dots+bv_b=k}} \;\dfrac{n!\,2^{u_1+u_2+\dots +u_a}}{u_0!u_1!\dots u_a!v_{a+1}!\dots v_b!}.\tag5$$
