Answer:
See explanation
Step-by-step explanation:
The most important thing to bear in mind when writing chemical reaction equation is that the equation must be balanced. A balanced chemical reaction equation is one in which the number of atoms of each element on the left and right hand sides of the reaction equation is exactly the same.
Equation of magnesium reaction with oxygen
2Mg(s) + O2(g) ------> 2MgO(s)
Equation of magnesium reaction with nitrogen
3Mg(s) + N2(g) ------> Mg3N2(s)