Calculate the binomial sum $ I_n=\sum_{i=0}^n (-1)^i { 2n+1-i \choose i} $

Generating Functions

Let's compute the generating function of $\displaystyle\sum_{k=0}^n(-1)^k\binom{n-k}{k}$: $$ \begin{align} \sum_{n=0}^\infty\sum_{k=0}^n(-1)^k\binom{n-k}{k}x^n &=\sum_{k=0}^\infty(-1)^kx^k\sum_{n=k}^\infty\binom{n-k}{k}x^{n-k}\\ &=\sum_{k=0}^\infty(-1)^kx^k\frac{x^k}{(1-x)^{k+1}}\\ &=\frac1{1-x}\frac1{1+\frac{x^2}{1-x}}\\ &=\frac1{1-x+x^2}\tag{1} \end{align} $$ What the question asks is for the odd terms, which we get by taking the odd part of $(1)$: $$ \frac12\left(\frac1{1-x+x^2}-\frac1{1+x+x^2}\right)=\frac{x}{1+x^2+x^4}\tag{2} $$ which implies that $\displaystyle\sum_{k=0}^n(-1)^k\binom{2n+1-k}{k}$ satisfies the recurrence $$ a_n=-a_{n-1}-a_{n-2}\tag{3} $$ and starts out: $(1,-1,0,1,-1,\dots)$ and $(3)$ ensures that it will follow this pattern. That is, $$ \boxed{\displaystyle\bbox[5px]{ \sum_{k=0}^n(-1)^k\binom{2n+1-k}{k}=\left\{\begin{array}{rl} 1&\text{if }n\equiv0\pmod{3}\\ -1&\text{if }n\equiv1\pmod{3}\\ 0&\text{if }n\equiv2\pmod{3}\\ \end{array}\right.}}\tag{4} $$


Solving the Recurrence $\boldsymbol{(3)}$

We can also get a solution by solving the recurrence $(3)$.

Since the roots of $x^2+x+1$ are $\frac{-1\pm i\sqrt3}{2}=e^{\pm i2\pi/3}$ and $a_0=1$ and $a_1=-1$, we get the general solution to be $$ \begin{align} a_n &=\frac{\left(\frac{-1+i\sqrt3}2\right)^{n+1}-\left(\frac{-1-i\sqrt3}2\right)^{n+1}}{i\sqrt3}\\[6pt] &=\frac{e^{i2\pi(n+1)/3}-e^{-i2\pi(n+1)/3}}{i\sqrt3}\\[4pt] &=\frac2{\sqrt3}\sin\left(\frac{2\pi(n+1)}{3}\right)\tag{5} \end{align} $$


This is much easier if we instead compute the sequence $a_m := \sum_{i=0}^\infty y^i {{m-i} \choose i}$ (note that most terms are zero). Then it is immediate that $a_{m+2}= a_{m+1}+y a_m$, from comparing terms and using $ [y^{i-1}]a_m + [y^i] a_{m+1} = {{m-(i-1)}\choose{i-1}}+{{m+1-i}\choose{i}} = {{m+2-i}\choose{i}} = [y^i]a_{m+2}$.

Substituting $y=-1$, it is not hard to see that the sequence $a_m$ has period $6$ (for example, the characteristic polynomial is cyclotomic). So $a_{2n+1}$ has period $3$.

This approach was inspired by looking at generating functions, which are a very powerful tool when you don't know what's going on. I've included that approach below.


Side note: the case $y=-1/4$ is particularly interesting, as we get the very clean answer of $a_m = (m+1)2^{-m}$.


Alternate solution, using generating functions:

$$f(x) := \sum_m a_m x^m$$

$$ = \sum_i y^i \sum_{m\geq 2i} {{m-i}\choose i} x^m = \sum_i (xy)^i \sum_{m'\geq i} {m'\choose i} x^{m'}$$

$$ = \sum_i (x y)^i \frac{x^i}{(1-x)^{i+1}} = \frac{1}{1-x} \sum_i \left(\frac{x^2y}{1-x} \right)^i$$

$$ = \frac{1}{1-x} \frac{1}{1-\frac{x^2 y}{1-x}} = \frac{1}{1-x-x^2 y}$$

Finally, we can read off the coefficients of $f(x)$ using partial fractions.


Start by restating the problem: we seek to evaluate $$\sum_{q=0}^n (-1)^q {2n+1-q\choose q} = \sum_{q=0}^n (-1)^q {2n+1-q\choose 2n+1-2q}.$$

Introduce the integral representation $${2n+1-q\choose 2n+1-2q} = \frac{1}{2\pi i} \int_{|z|=\epsilon} \frac{(1+z)^{2n+1-q}}{z^{2n+2-2q}} \; dz.$$

This gives the following for the sum (note that the integral correctly represents the fact of the binomial coefficient being zero for $q>n$, so we may extend the sum to infinity): $$\frac{1}{2\pi i} \int_{|z|=\epsilon} \frac{(1+z)^{2n+1}}{z^{2n+2}} \sum_{q\ge 0} (-1)^q \frac{z^{2q}}{(1+z)^q} \; dz \\ = \frac{1}{2\pi i} \int_{|z|=\epsilon} \frac{(1+z)^{2n+1}}{z^{2n+2}} \frac{1}{1+z^2/(1+z)} \; dz \\ = \frac{1}{2\pi i} \int_{|z|=\epsilon} \frac{(1+z)^{2n+2}}{z^{2n+2}} \frac{1}{1+z+z^2} \; dz.$$

Extracting coefficients we find $$\sum_{q=0}^{2n+1} {2n+2\choose 2n+1-q} [z^q] \frac{1}{1+z+z^2} = \sum_{q=0}^{2n+1} {2n+2\choose q+1} [z^q] \frac{1}{1+z+z^2}.$$

Introduce the generating function $$Q(w) = \sum_{n\ge 0} w^{2n+1} \sum_{q=0}^{2n+1} {2n+2\choose q+1} [z^q] \frac{1}{1+z+z^2},$$ which is $$\sum_{q\ge 0} w^q [z^q] \frac{1}{1+z+z^2} \sum_{2n+1\ge q} {2n+2\choose q+1} w^{2n+1-q} \\ = \sum_{q\ge 0} w^q [z^q] \frac{1}{1+z+z^2} \sum_{p\ge 0} {p+q+1\choose q+1} w^p \\ = \sum_{q\ge 0} w^q [z^q] \frac{1}{1+z+z^2} \frac{1}{(1-w)^{q+2}} \\ = \frac{1}{(1-w)^2} \sum_{q\ge 0} \left(\frac{w}{1-w}\right)^q [z^q] \frac{1}{1+z+z^2}.$$

What we have here is an annihilated coefficient extractor and the sum simplifies to $$Q(w) = \frac{1}{(1-w)^2} \frac{1}{1+w/(1-w) + w^2/(1-w)^2} \\ = \frac{1}{(1-w)^2+w(1-w) + w^2} = \frac{1}{1-w+w^2}.$$

This is the ordinary generating function of a sequence with recurrence $$a_{n+2} = a_{n+1} - a_n.$$ Since $a_0 = 1$ and $a_1 = 1$ we obtain $$1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0\ldots$$ thereby proving periodicity with period six.

Selecting the odd-index values preserves periodicity and we get the sequence $$1, -1, 0, 1, -1, 0, \ldots$$

Post Scriptum. If we introduce $$\rho_{1,2} = \frac{1\pm i\sqrt{3}}{2} \quad\text{and set}\quad c_{1,2} = \frac{3\pm i\sqrt{3}}{6}$$ we have the closed form $$[w^n] \frac{1}{1-w+w^2} = c_1 \rho_1^{-n} + c_2 \rho_2^{-n}$$ from which $[w^{2n+1}] Q(w)$ may be extracted.

The technique of annihilated coefficient extractors (ACE) is also employed at this MSE link I and this MSE link II.

A trace as to when this method appeared on MSE and by whom starts at this MSE link.