To determine the moles in 40 grams of magnesium, we need the atomic weight. This can easily be found on a periodic table. For this problem, let's use 24.305 grams/mole.
We are going to set up an equation to determine this problem. In this equation, we want all our units to cancel out except for 'moles.'
[tex]\frac{40 g Mg}{1} x\frac{1 mole Mg}{24.305 g Mg}[/tex]
In this, we can see that the unit 'grams' will cancel out to leave us with moles.
In solving the equation, we determine that there are approximately 1.65 moles of Magnesium.