The formalism of polynomials of quantum numbers is generalized to the case of degenerate states and general recurrence relations are derived. A theorem of extraneous quantum numbers—the quantum numbers appearing in the anharmonic Hamiltonian as parameters—is formulated. With the help of this theorem the polynomial formalism is extrapolated to the case of rotation, and a simple and correct algorithm for deriving the coefficients of the Herman-Wallis factor is proposed. The expressions obtained for the first coefficients are more obvious than the conventional formulas and their application to the hydrogen iodide molecule leads to good agreement with modern experimental data. The necessity of taking into account the part of the magnetic dipole moment nonlinear in the spin variables—the magneto-optical anharmonicity—is shown for systems with the spin-spin interaction.