How to Write the Formula for Ionic Compounds