Magnesium reacts with an element to form an ionic compound with the ground state electronic configuration of , the simplest formula for this compound is -
electronic configuration of is so valency of will be 3
Magnesium ion
Formula :
Hence option 4 is correct.