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.'
![(40 g Mg)/(1) x(1 mole Mg)/(24.305 g Mg)](https://img.qammunity.org/2020/formulas/chemistry/middle-school/q0u22yn7bc7briy3wkotp0im1ncillmdmw.png)
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.