Final answer:
The chemical formula for a compound made of magnesium ions (Mg2+) and oxygen ions (O2-) is MgO, representing magnesium oxide, an ionic compound created through the transfer of electrons and subsequent formation of an ionic bond.
Step-by-step explanation:
The chemical formula for a compound made of magnesium ions (Mg2+) and oxygen ions (O2-) is MgO, which stands for magnesium oxide. In this ionic compound, magnesium donates its two valence electrons to empty its own orbital and fill oxygen's, resulting in the formation of a Mg2+ ion and an O2- ion. The two ions each have octets as their valence shell, indicating a full outer electron shell, and the attraction between the oppositely charged particles forms a strong ionic bond. The balanced chemical equation for the reaction of magnesium with oxygen is 2Mg + O2 → 2MgO, as two magnesium atoms are required to combine with one oxygen molecule, which brings two oxygen atoms together, thus producing two units of magnesium oxide.