To obtain the mole ratio, divide the moles of water by moles of anhydrate. 5 H2O/1 mole MgSO4 moles = 5:1. To write the equation, use the mole ratio. Because for every 1 mole of MgSO4 there are 5 moles of H2O, the formula is 5H2O MgSO4.