Green's function approach to the direct perturbation calculation of the excitation energies of closed shell fermion systems