in many compounds, atoms of main-group elements form ions so that the number in the outermost energy levels of each ion is