Number of terms in the expansion of $\left(1+\frac{1}{x}+\frac{1}{x^2}\right)^n$ 
Number of terms in the expansion of $$\left(1+\frac{1}{x}+\frac{1}{x^2}\right)^n$$ 

$\bf{My\; Try::}$ We can write $$\left(1+\frac{1}{x}+\frac{1}{x^2}\right)^n=\frac{1}{x^{2n}}\left(1+x+x^2\right)^n$$
Now we have to calculate number of terms in $$(1+x+x^2)^n$$ and divided each term by $x^{2n}$
So $$(1+x+x^2)^n = \binom{n}{0}+\binom{n}{1}(x+x^2)+\binom{n}{2}(x+x^2)^2+......+\binom{n}{n}(x+x^2)^n$$
and divided each term by $x^{2n}$
So we get number of terms $\displaystyle  = 1+2+3+.....+n+1 = \frac{(n+1)(n+2)}{2}$
Is my solution is Right, If not then how can i calculate it
actually i don,t have solution of that question.
Thanks
 A: When you expand $(1 + x + x^2)^n$, the highest degree is $2n$, and the lowest is 0. None of them is vanished, and it can be seen easily that there is one term of any degree between 0 and $2n$. So there should be $2n + 1$ terms.
Cheers,
A: The answer is $2n+1$, but let me take the long tour...
You know how to write $(a+b)^n$ with binomial coefficients.  Now you have to understand how to write $(a+b+c)^n$ with some other kind of coefficients.
The general case involves the so-called multinomial coefficients, but we do not need them in general.
So let's try to consider the combinatorial problem that leads to the formula.
Imagine you have $$(a+b+c)(a+b+c)\cdots(a+b+c)$$ 
$n$ times.
The complete expansion of that product, without collecting similar terms, will have $3^n$ terms, and since each monomial come from a product of $n$ "variables", the sum of the degrees in the term $a^ib^jc^h$ will always be equal to $i+j+h=n$.
Now you ask yourself which is the coefficient of $a^ib^jc^h$ in the product.
The $a$ can come from $n$ addends, and there are $C(n,i)$ ways in which you can select $i$ of them. Now the $b$ can come from $n-i$ terms, so you have another factor $C(n-i,j)$. Once the terms that contribute an $a$ and those which contribute a $b$ are fixed, the other terms will contribute a $c$, so we are done.
Expanding $C(n,i)\cdot C(n-i,j)$ in factorials, we get
$$\frac{n!}{i!\cdot(n-i)!}\cdot\frac{(n-i)!}{j!\cdot(n-i-j)!}=\frac{n!}{i!\cdot j!\cdot h!}$$
since $n-i-j=h$.
Hence we can write
$$(a+b+c)^n=\sum_{i+j+h=n}\frac{n!}{i!\cdot j!\cdot h!}a^ib^jc^h=\sum_{i+j\le n}\frac{n!}{i!\cdot j!\cdot (n-i-j)!}a^ib^jc^{n-i-j}
$$
So, the number of terms in the general case $(a+b+c)^n$ will be equal to the number of ways $0\le i+j\le n$ with $0\le i,j\le n$.
It is easy to see that this number in general it is $(n+1)(n+2)/2$.
However, in your case the $a$, $b$ and $c$ are not independent, because they are all powers of $1/x$.
In your case it is easy to see that 
$$1^i\cdot\left(\frac{1}{x}\right)^j\left(\frac{1}{x^2}\right)^h$$
as $i,j,h$ varies as we have seen, can be any power of $1/x$ between $0$ and $2n$, so the actual number of terms will be $2n+1$.
A: The number of terms in the expansion of $$\left(1+\frac1{x}+\frac1{x^2}\right)^n=\dfrac{(1+x+x^2)^n}{x^{2n}}$$
will be same as in $(1+x+x^2)^n$
As $a^3-b^3=(a-b)(a^2+ab+b^2),$
$$(1+x+x^2)^n=\left(\dfrac{1-x^3}{1-x}\right)^n =(1-x^3)^n(1-x)^{-n}$$
The highest & the lowest power of $x$ in $(1+x+x^2)^n$ are $0,2n$ respectively.
Clearly, all the terms present in $1\cdot(1-x)^{-n}$ (using Binomial Series expansion) as in $(1-x^3)^n(1-x)^{-n}$
