Write the formula for the ion formed when each of the following elements obtains noble gas configuration: bromine magnesium aluminum