Sometimes the name of the compound gives information about the formula of that compound. Names of these compounds have prefixes that give the number of atoms of certain elements in each molecule.
For example, magnesium oxide is made up of two elements, magnesium and oxygen. Its formula is MgO. This shows that it has one atom of magnesium for every one atom of oxygen.