Solution (source code)

= Solution

First apply <integration by parts> with $u=x^k$ and $dv=\sin x\,dx$:
$$
F(k)=\big[-x^k\cos x\big]_0^\pi
+k\int_0^\pi x^{k-1}\cos x\,dx
=\pi^k+k\int_0^\pi x^{k-1}\cos x\,dx.
$$
For $k>1$, integrate the remaining integral by parts once more. Its boundary term $[x^{k-1}\sin x]_0^\pi$ is zero, so
$$
\boxed{F(k)=\pi^k-k(k-1)F(k-2).}
$$
At $k=1$, direct <integration> gives $F(1)=\pi$, agreeing with the same formula; the coefficient of $F(-1)$ vanishes and that integral is finite. Now follow the odd chain:
$$
F(3)=\pi^3-6\pi,\qquad
\boxed{F(5)=\pi^5-20\pi^3+120\pi.}
$$
This is the <sine-weighted power integral recurrence>.