TITLE: Is it possible to determine the number of terms in a multinomial expansion, if all terms are exponents of $x$?
QUESTION [6 upvotes]: Is it possible to determine the number of terms in a multinomial expansion, if all terms are exponents of $x$? For example, number of terms in the expansion of $(1+x^2+x^4+x^5)^7$ ?

Clearly, the formula $\binom{n+k-1}{k-1}$ isn't valid as we don't have different $x_i's$, but the exponents of same variable.
The above was just an example, but I am looking for number of terms in the expansion $$(x^{a_1}+x^{a_2}+\cdots+x^{a_k})^n$$ where $a_1,a_2,\cdots,a_k$ are integers and $n$ is a positive integer.
I have seen a few posts related to this, but they work in specific cases for example, this and this.

REPLY [2 votes]: Application of the multinomial theorem in the specific case gives
\begin{align*}
(1+x^2+x^4+x^5)^7=\sum_{q=0}^{35}\sum_{{0j_0+2j_2+4j_4+5j_5=q}\atop{{j_0+j_2+j_4+j_5=7}\atop{j_0,j_2,j_4,j_5\geq 0}}}
\binom{7}{j_0,j_2,j_4,j_5}x^q\tag{1}
\end{align*}
We observe the number of different powers of $x$ is the number of different $4$-tuples $(j_0,j_2,j_4,j_5)$ which fulfill the conditions
\begin{align*}
0j_0+2j_2+4j_4+5j_5&=q\qquad(0\leq q\leq 35)\\
j_0+j_2+j_4+j_5&=7\\
j_0,j_2,j_4,j_5&\geq 0
\end{align*}
In general we can wlog assume $a_1< a_2< \cdots< a_k$. We obtain
\begin{align*}
(x^{a_1}+x^{a_2}+\cdots+x^{a_k})^n
&=\sum_{q=0}^{n a_k}\sum_{{\sum_{r=1}^k r j_r=q}\atop{{\sum_{r=1}^k j_r=n}\atop{j_r\geq 0, 1\leq r\leq k}}}
\binom{n}{j_1,j_2,\ldots,j_k}x^q
\end{align*}

As in the specific case above we observe the number of different powers of $x$ is the number of different $k$-tuples $(j_r)_{1\leq r\leq k}$ which fulfill the conditions
\begin{align*}
&\sum_{r=1}^k r j_r=q\qquad(0\leq q\leq na_k)\\
&\sum_{r=1}^k j_r=n\tag{2}\\
&j_r\geq 0\qquad\qquad\ (1\leq r\leq k)
\end{align*}

As far as I know there is no simple solution to calculate the number of wanted $k$-tuples  fulfilling the conditions in (2).