From the balanced equation we have:
3Mg + N2 ............> Mg3N2
we can see that:
3 moles of magnesium react with 2 moles of nitrogen.
This means that:
72 grams of magnesium are required to react with 28 grams of nitrogen.
Therefore, to calculate the amount of Mg needed to react with 10 grams of N2, all you have to do is cross multiplication as follows:
mass of Mg = (10*72) / 28 = 25.714 grams