A limit of combination I want to find the closed form of the limit,
\begin{align*}
I(k,r):=\lim_{x\rightarrow 0}\left\{\sum\limits_{j=1}^{r+2-k} (-1)^{r+3-j-k} \binom{r-j}{k-2}\frac{1}{x^j}+\frac{1}{(1+x)^{k-1}x^{r-k+2}}\right\}=?
\end{align*}
where 
$$r\ge k-1\quad (k,r\in \mathbb{N}).$$
For example, letting $r=k$, we have
$$ I(k,k)=\frac{k(k-1)}{2}.$$
 A: Since we have $r\geq k-1$ it is convenient to set $r=k-1+l$ with $l\geq 0$.

We obtain
  \begin{align*}
&\color{blue}{I(k,k-1+l)}\\
&\quad=\lim_{x\to 0}\left\{\sum_{j=1}^{l+1}(-1)^{l-j}\binom{k-1+l-j}{k-2}\frac{1}{x^j}+\frac{1}{(1+x)^{k-1}x^{l+1}}\right\}\tag{1}\\
&\quad=\lim_{x\to 0}\left\{\sum_{j=0}^l(-1)^{l-j+1}\binom{k+l-j-2}{l-j}\frac{1}{x^{j+1}}
+\frac{1}{x^{l+1}}\sum_{j=0}^\infty\binom{-(k-1)}{j}x^j\right\}\tag{2}\\
&\quad=\lim_{x\to 0}\left\{\sum_{j=0}^l(-1)^{j+1}\binom{k+j-2}{j}\frac{1}{x^{l-j+1}}
+\frac{1}{x^{l+1}}\sum_{j=0}^\infty\binom{k+j-2}{j}(-x)^j\right\}\tag{3}\\
&\quad=\lim_{x\to 0}\left\{\frac{1}{x^{l+1}}\sum_{j=l+1}^\infty\binom{k+j-2}{j}(-x^j)\right\}\tag{4}\\
&\quad\,\,\color{blue}{=(-1)^{l+1}\binom{k+l-1}{l+1}}\tag{5}
\end{align*}

Comment:


*

*In (1) we set $r=k-1+l$ in $I(k,r)$.

*In (2) we shift the index of the sum by one to start with $j=0$ and we use the binomial series expansion.

*In (3) we reverse the order of summation in the finite sum by setting $j\to l-j$. We also apply the binomial identity $\binom{-p}{q}=\binom{p+q-1}{q}(-1)^q$.

*In (4) we see the $l+1$ terms of the sum cancel. The series now starts with $j=l+1$.

*In (5) we apply the limit and all terms cancel besides the term with $x^0$.

We finally conclude from (5) by using $r=k-1+l$
\begin{align*}
\color{blue}{I(k,r)}&=(-1)^{r-k}\binom{r}{r-k+2}\color{blue}{=(-1)^{r-k}\binom{r}{k-2}}
\end{align*}

Note: The result is in accordance with $OP's$ example: $$I(k,k)=\binom{k}{k-2}=\binom{k}{2}=\frac{k(k-1)}{2}$$
