Write the rules involved in writing a chemical formula.
Rule 1: The valencies or charges on the ion must balance.
Rule 2: When a compound consists of a metal and a nonmetal, the name or symbol of the metal is written first.
Rule 3: For polyatomic ions, the formula of ion is enclosed in a bracket and the number of ions is written outside the bracket. If the number of polyatomic ions is 1, the bracket is not required.