Writing Chemical Formulas for Ionic Compounds