Solution (source code)

= Solution

Let $M$ be the mass measured in the uncompactified 25-dimensional spacetime. The quantum zero-mode constraints are
$$
0=L_0-a=\frac{\alpha'}4(-M^2+p_L^2)+N-a,
\qquad
0=\widetilde L_0-a=\frac{\alpha'}4(-M^2+p_R^2)+\widetilde N-a.
$$
The <string level operators>
$$
N=\sum_{r>0}\alpha_{-r}\mathbin\cdot\alpha_r,
\qquad
\widetilde N=\sum_{r>0}\widetilde\alpha_{-r}\mathbin\cdot\widetilde\alpha_r
$$
have nonnegative integer eigenvalues. Adding the constraints and using $(p_L^2+p_R^2)/2=n^2/R^2+w^2R^2/\alpha'^2$ gives
$$
\boxed{M^2=\frac{n^2}{R^2}+\frac{w^2R^2}{\alpha'^2}
+\frac2{\alpha'}(N+\widetilde N-2a)}.
$$
Their difference gives <closed-string level matching>, $N-\widetilde N+nw=0$ with the present left-right convention. The <normal-ordering constant of a string> $a$ is the regularized zero-point energy generated when oscillator products are normal ordered.