I am trying to write a function which will perform the equation in the attached image. So far, I have:

```
x[n_] :=
 x[n] =
  2^(1 - n) Sum[Binomial[n, k] T[n - 2 k], {k, 0, n/2}]

x[6]

```

which outputs:

$ \frac{1}{32} (20 T(0)+15 T(2)+6 T(4)+T(6)) $

How can I write an `If[]` (or similar) statement to half the `kth` term when `n` is even and `k=n/2`?
Thanks in advance!

![Equation 2.14](https://i.stack.imgur.com/NKC7G.png)