* Magnesium is in group 2 of the periodic table, meaning it has a +2 charge as a cation (Mg²⁺).
* Nitrogen is in group 15, meaning it has a -3 charge as an anion (N³⁻).
To create a neutral compound, we need three magnesium ions (3 x +2 = +6) and two nitrogen ions (2 x -3 = -6). This gives us the formula Mg₃N₂.