Your equations, in terms of number fractions, are correct, but in your case equations in terms of weight fractions would be more useful.
The mass of species i is NiMi, and its weight fraction Wi is NiMi/ΣNiMi
The average equations can then be rewritten as
Number average = ΣWi/Σ(Wi/Mi)
Weight average = ΣWiMi/ΣWi