Section 9.5 of the chemistry-first version
and Section 6.8 of the atoms-first version of
An Introduction to Chemistry
by Mark Bishop
Calculating Empirical and Molecular Formulas
Click here to see this lecture with captions.