# find $\sum_{k=0}^{t}(-1)^k\binom{t}{k}^2$ for odd t then for even t

find $$\sum_{k=0}^{t}(-1)^k\binom{t}{k}^2$$ for $t=2n$ then for $t=2n+1$

I tried by expand $(1-x)^n(1-x)^n$, with no result.

Any Help ?

#### Solutions Collecting From Web of "find $\sum_{k=0}^{t}(-1)^k\binom{t}{k}^2$ for odd t then for even t"

It is better to exploit symmetry. Since $\binom{t}{k}=\binom{t}{t-k}$, we have:
$$\sum_{k=0}^{t}\binom{t}{k}^2(-1)^k = [x^t]\left[\left(\sum_{k=0}^{t}\binom{t}{k}(-1)^k x^k\right)\cdot\left(\sum_{k=0}^{t}\binom{t}{t-k}x^{t-k}\right)\right]$$
hence:
$$\sum_{k=0}^{t}\binom{t}{k}^2(-1)^k = [x^t]\left[(1-x)^t(1+x)^t\right]=[x^t](1-x^2)^t$$
so:
$$\sum_{k=0}^{t}\binom{t}{k}^2(-1)^k=\left\{\begin{array}{rcl}0&\text{if}&t\equiv 1\pmod{2},\\ \binom{t}{t/2}(-1)^{t/2}&\text{if}&t\equiv 0\pmod{2}.\end{array}\right.$$

$\ds{\sum_{k = 0}^{t}\pars{-1}^{k}{t \choose k}^{2}:\ {\large ?}}$.

\begin{align}&\color{#66f}{\large\sum_{k = 0}^{t}\pars{-1}^{k}{t \choose k}^{2}}
=\sum_{k = 0}^{t}\pars{-1}^{k}{t \choose k}
\oint_{\verts{z}\ =\ 1}{\pars{1 + z}^{t} \over z^{k + 1}}\,{\dd z \over 2\pi\ic}
\\[3mm]&=\oint_{\verts{z}\ =\ 1}{\pars{1 + z}^{t} \over z}
\sum_{k = 0}^{t}{t \choose k}\pars{-\,{1 \over z}}^{k}\,{\dd z \over 2\pi\ic}
=\oint_{\verts{z}\ =\ 1}{\pars{1 + z}^{t} \over z}
\bracks{1 + \pars{-\,{1 \over z}}}^{t}\,{\dd z \over 2\pi\ic}
\\[3mm]&=\pars{-1}^{t}\oint_{\verts{z}\ =\ 1}{\pars{1 – z^{2}}^{t} \over z^{t + 1}}
\,{\dd z \over 2\pi\ic}
=\pars{-1}^{t}\sum_{k=0}^{t}{t \choose k}\pars{-1}^{k}
\oint_{\verts{z}\ =\ 1}{1 \over z^{t – 2k + 1}}\,{\dd z \over 2\pi\ic}
\\[3mm]&=\pars{-1}^{t}\sum_{k=0}^{t}{t \choose k}\pars{-1}^{k}\delta_{k,t/2}
\end{align}

$$\color{#66f}{\large\sum_{k = 0}^{t}\pars{-1}^{k}{t \choose k}^{2}} =\color{#c00000}{\large% \left\{\begin{array}{lcl} \pars{-1}^{t/2}{t \choose t/2} & \mbox{if} & t\ \mbox{is even} \\[2mm] 0 & & \mbox{otherwise} \end{array}\right.}$$