Hidden symmetry and the number-theoretic structure of the energy levels of a perturbed harmonic oscillator