  Relativistic third-order MBPT is applied to obtain energies of ions with two
valence electrons in the no virtual-pair approximation (NVPA). A total of 302
third-order Goldstone diagrams are organized into 12 one-body and 23 two-body
terms. Only third-order two-body terms and diagrams are presented here, owing
to the fact that the one-body terms are identical to the previously studied
third-order terms in monovalent ions. Dominant classes of diagrams are
identified. The model potential is a Dirac-Hartree-Fock $V^{N-2}$ potential,
and B-spline basis functions in a cavity of finite radius are employed in the
numerical calculations. The Breit interaction is taken into account through
second order of perturbation theory and the lowest-order Lamb shift is also
evaluated. Sample calculations are performed for berylliumlike ions with Z =
4--7, and for the magnesiumlike ion P IV. The third-order energies are in
excellent agreement with measurement with an accuracy at 0.2% level for the
cases considered. Comparisons are made with previous second-order MBPT results
and with other calculations. The third-order energy correction is shown to be
significant, improving second-order correlation energies by an order of
magnitude.
