Hey ellis you are right about how to do it.
heres how i worked it out, hope this helps.
the weight on 1mole of CaSO4 is 136.9g.
therefore if you work out how much mass is needed as a ratio
1st part ratio between mass you have and mass for one mole is:
25.7 / 136.9 = 0.188
Ca : S : O
40.8 : 32.1 : 64 <------ mass in g for 1 mole
Divide mass for 1 mole by the ratio above (0.188)
7.67 : 6 : 12 <-------- mass in g for 0.188 moles
now you have the mass of O in your compound which is 12g so you can do
12/16 = 0.75 moles [mass / RMM = no moles]
Hope this helps
Prit