By considering $x^{n}+x^{\left(n-1\right)}\left(1+x\right)+x^{\left(n-2\right)}\left(1+x\right)^{2}+...+\left(1+x\right)^{n}$, find the sum of $\begin{pmatrix}n\\ r\end{pmatrix}+\begin{pmatrix}n-1\\ \:r-1\end{pmatrix}+\begin{pmatrix}n-2\\ \:\:r-2\end{pmatrix}+...+\begin{pmatrix}n-r+1\\ \:\:1\end{pmatrix}$.
I have found the sum of the Sum GP to be $$\frac{x^{n+1}-\left(1+x\right)^{n+1}}{2x-1}$$
Now, if I consider $x^{n}+x^{\left(n-1\right)}\left(1+x\right)+x^{\left(n-2\right)}\left(1+x\right)^{2}+...+\left(1+x\right)^{n}$, I tried to find the term $x^r$ which works well EXCEPT for $\begin{pmatrix}n-r+1\\ \:\:1\end{pmatrix}$. The term of this is not $x^r$, but $x^{n+2}$ which is out of place. By my way, the final term should be $\begin{pmatrix}n-r\\ r-r\end{pmatrix}$. What am I doing wrong?
The required can be re-written as $$S=\sum_{j=1}^{r} {n-(j-1) \choose r-(j-1)}=\sum_{j=1}^{r} {n-(j-1) \choose n-r}=\sum_{k=0}^{r-1} {n-k \choose n-r}$$ $$\implies S=[x^{n-r}]~~ \sum_{k=0}^{r-1} (1+x)^{n-k}=[x^{n-r}]\left((1+x)^n \frac{(1+x)^{-r}-1}{(1+x)^{-1}-1}\right)$$ $$S=[x^{n-r}]~~ \left( (1+x)^n \frac{(1+x)^{-r+1}-(1+x)}{-x}\right)$$ $$S=[x^{n-r+1}] ~~ ((1+x)^{n+1}-(1+x)^{n-r+1})$$ $$S={n+1 \choose n-r+1}-1= {n+1 \choose r}-1$$
Here $[x^j]~ F(x)$ means the coefficient of $x^j$ in $F(x)$.