We have the number of moles of magnesium, now we will use the Avogadro number to determine formula units:

Avogadro number says that one mole of a substance is equal to 6.022 × 10²³ units of that substance (such as atoms, molecules, or ions). Does not matter which is the substance, always 1 mol will be 6.022 x 10^23 formula units.
We have 1.27 moles so we will have:

1.27 moles of magnesium are equivalent to 7.65 x 10^23 formula units