Solution (source code)

= Solution

The emitted photon carries the decrease in atomic <energy>, so $hc/\lambda=E_n-E_m$ for $n>m$. Using the preceding energy levels gives
$$
\boxed{\frac1\lambda=R_MZ^2\left(\frac1{m^2}-\frac1{n^2}\right).}
$$
The lower state's energy is more negative, making the right-hand side positive. This is the hydrogenic <Rydberg formula>, with the finite-nuclear-mass factor included in $R_M$.