Systematics of energies of particle-hole states in the 2s-ld and 1f72 shells