Mole Fraction and Atom Fraction
The fallacy lies in the assumption that mole fraction and the number fraction are always the same.
For example, take $\ce{Na2SO4}$
what is the atom fraction of Na: 2/(2+1+4) = 2/7
What about the mole fraction of Na? It 2$N_A$/$N_A$(2+1+4)= 2/7
However, this &quot;simple&quot; formula of yours breaks down in the case of mixtures even if we mix them in 1:1 mol ratio. Calculate the mol fraction of Na ions in a mixture using your formula for $\ce{NaCl}$ and $\ce{Na2SO4}$ and see that you will not get the right answer.