Solution (source code)

= Solution

The <rotation matrix> $e^{xA}$ commutes with $C$ and is <orthogonal matrix>[orthogonal], so
$$
e^{xA}C(e^{xA})^T=C.
$$
Since $C^n=\operatorname{diag}(1,(-1)^n,(-1)^n)$,
$$
\boxed{\sum_{n=1}^N\left(e^{xA}C(e^{xA})^T\right)^n
=\operatorname{diag}\left(N,\frac{(-1)^N-1}{2},\frac{(-1)^N-1}{2}\right)}.
$$