Variational predictions of transition energies and electron affinities: He and Li ground states and Li, Be, and Mg core-excited states.