Solution (source code)

= Solution

For $x=\cos\theta\in[-1,1]$,
$$
T_n(-x)=\cos(n(\pi-\theta))=(-1)^n\cos(n\theta)=(-1)^nT_n(x).
$$
Both sides are <polynomials> in $x$. Since they agree on an interval, the <polynomial> identity theorem extends the equality to every real $x$. Thus $T_n$ is even for even $n$ and odd for odd $n$.