Finding the molecular formula from a mass spectrum