If there are two an element
In the given problem about Hafnium, 5 isotopes have been given.
Extending the above expression to 5 isotopes
We obtain
-.-.-.-.-.-.-.-.-.-.-.-.-.-
(Ensure that sum of all fractions adds to 1.
It is easy to find the fraction of each isotope in the question as total number is given as 100 atoms. Number of each isotope divided by 100)
Always use average atomic masses for mass calculations involving or .