Solution (source code)

= Solution

First construct the periodic response required in the introductory clause. At $\omega_0^2=1/(LC)$, the terms $LI_0''+I_0/C$ cancel for a sinusoid, leaving $RI_0'=\omega_0\cos(\omega_0t)$. Thus
$$
\boxed{I_0(t)=\frac1R\sin(\omega_0t),\qquad I_M=\frac1R.}
$$
This <resonant series RLC response> dissipates <energy> through <Joule heating>. Over one period,
$$
\boxed{D=\frac1R\int_0^T\sin^2(\omega_0t)\,dt
=\frac{T}{2R}=\frac{\pi}{R\omega_0}.}
$$
The <Q factor>, using the maximum magnetic <energy> $LI_M^2/2$, is consequently
$$
\boxed{Q=\frac{2\pi}{D}\frac{LI_M^2}{2}=\frac{L\omega_0}{R},\qquad
Q\omega_0RC=LC\omega_0^2=1.}
$$