I think you are overthinking the problem. The formula you wrote allows you to calculate the energy of an electron in a given orbital. However, they give you these energies in the problem, so there is no need to calculate them. So, when an electron transitions from a higher energy orbital to a lower energy orbital, the energy of the photon released by the transition is equal to the difference in energies of the two orbitals. For example, if an electron falls from an n = 6 orbital to the n=1 orbital, the photon released has an energy of E = E6 - E1.