<s>[INST] number of distinct terms in binomial expansion of $\left(x+x^{-1}+x^2+x^{-2}\right)^{15}$ Question -> How do I find the number of distinct terms in the binomial expansion of $$\left(x+\frac{1}{x}+x^2+\frac{1}{x^2}\right)^{15}$$
Solution I tried ->
$$\left(\frac{x^3+x+x^4+1}{x^{2}}\right)^{15}=x^{-30}\left(1+x+x^3+x^4\right)^{15}$$ is in the form of
$$x^{-30}\left(a_{0}+a_{1}x+....a_{60}x^{60}\right)$$ 
I did not understand which powers of $x$ are present and which are absent.
How do I find the number of distinct terms?
 [/INST] We can get any exponent from $0$ to $60$. Thus, there are $61$ distinct terms.
Consider
$$
\left(1+x+x^3+x^4\right)^{15}
$$
For $0\le k\le30$, there is a way to get $x^k$ by
$$
\color{#C00}{1}^{15-k+2\lfloor k/3\rfloor}\color{#C00}{x}^{k-3\lfloor k/3\rfloor}\color{#C00}{x}^{\color{#C00}{3}\lfloor k/3\rfloor}
$$
since $k-2\lfloor k/3\rfloor\le11$.
For $0\le k\le30$, there is a way to get $x^{60-k}$ by
$$
\color{#C00}{x}^{\color{#C00}{4}(15-k+2\lfloor k/3\rfloor)}\color{#C00}{x}^{\color{#C00}{3}(k-3\lfloor k/3\rfloor)}\color{#C00}{x}^{\lfloor k/3\rfloor}
$$
since $k-2\lfloor k/3\rfloor\le11$.
</s>