<s>[INST] A sum with binomial coefficients Show that $$\sum_{k=0}^{n}(-1)^k\binom{n}{k}(n-2k)^{n+2}=\frac{2^{n}n(n+2)!}{6}.$$
 [/INST] Suppose we seek to evaluate
$$\sum_{k=0}^n {n\choose k} (-1)^k (n-2k)^{n+2}.$$
Introduce
$$(n-2k)^{n+2}
= \frac{(n+2)!}{2\pi i}
\int_{|z|=\epsilon} \frac{1}{z^{n+3}} \exp((n-2k)z) \; dz.$$
We thus get for the sum
$$\frac{(n+2)!}{2\pi i}
\int_{|z|=\epsilon} \frac{1}{z^{n+3}} 
\sum_{k=0}^n {n\choose k} (-1)^k \exp((n-2k)z) \; dz
\\ = \frac{(n+2)!}{2\pi i}
\int_{|z|=\epsilon} \frac{1}{z^{n+3}} \exp(nz)
\sum_{k=0}^n {n\choose k} (-1)^k \exp(-2kz) \; dz
\\ = \frac{(n+2)!}{2\pi i}
\int_{|z|=\epsilon} \frac{1}{z^{n+3}} \exp(nz)
\left(1-\exp(-2z)\right)^n \; dz.$$
Categorizing the  contributions to the  residue according to  the term
from  the exponential raised  to the  power $n$  and using  the series
expansion
$$1-\exp(-2z) = 2z - 2z^2 + \frac{4}{3}z^3 - \cdots$$
we get
First, with $z^n$, $$\frac{1}{2} n^2 \times 2^n.$$
Second, with $z^{n+1}$, $$n \times - {n\choose 1} 2^n.$$
Third, with $z^{n+2}$, $$1 \times {n\choose 2} 2^n
+ 1 \times {n\choose 1} 2^{n-1} \times \frac{4}{3}.$$
Collecting these yields
$$\left(\frac{1}{2} n^2 - n^2 + \frac{1}{2} n(n-1) 
+ \frac{2}{3} n\right) \times 2^n.$$
This is
$$\left(\frac{2}{3}-\frac{1}{2}\right)n\times 2^n,$$
for a final answer of
$$\frac{1}{6} n \times 2^n \times (n+2)!$$
</s>