Solution (source code)

= Solution

A smooth <quantum rotor> with no flux or twist requires both
$$
\Phi(\phi+2\pi)=\Phi(\phi),\qquad
\Phi'(\phi+2\pi)=\Phi'(\phi).
$$
For the sine family, $\Phi_n(0)=\Phi_n(2\pi)=0$ holds for every positive integer $n$, but
$$
\Phi_n'(0)=\frac{n}{2\sqrt\pi},\qquad
\Phi_n'(2\pi)=\frac{n}{2\sqrt\pi}(-1)^n.
$$
The derivatives match only for \b[$\boxed{n=2k,\quad k=1,2,3,\ldots}$]. Equivalently, $\sin[n(\phi+2\pi)/2]=(-1)^n\sin(n\phi/2)$ must be periodic for every $\phi$, not merely vanish at the chosen join. Odd $n$ would produce a cusp in a periodic continuation and do not belong to the smooth free-ring Hamiltonian's domain.