<s>[INST] To find number of distinct terms of binomial expansion I have binomial expansion as 
$(x+\frac{1}{x} + x^2 + \frac{1}{x^2})^{15}$. 
How do i find number of distinct terms in it. Distinct in sense means terms having different powers of $x$?
I have simplified this as $\frac{1}{x^{30}}(x^3+x+x^4+1)^{15}$. How do i proceed
Thanks
 [/INST] $$\frac{1}{x^{30}}(x^3+x+x^4+1)^{15}=\frac{1}{x^{30}}(x^3(x+1)+x+1)^{15}=$$
$$=\frac{1}{x^{30}}(x^3+1)^{15}(x+1)^{15}=\frac{1}{x^{30}}\sum_{i=0}^{15}\binom{15}{i}x^{3i}\sum_{j=0}^{15}\binom{15}{j}x^{j}=$$
$$=\sum_{i=0}^{15}\binom{15}{i}\sum_{j=0}^{15}\binom{15}{j}x^{3i+j-30}$$
Number of elements in set
$$\{3i+j-30:i,j\in\{0,1,...,15\}\}=\{-30,-29,...,0,1,...,30\}$$ show the distinct powers of $x$
</s>