Electronic configuration of atoms and ions