\(Mg+X_2\rightarrow MgX_2\)
\(2Al_3+3X_2\rightarrow2AlX_3\)
\(n_{X2}=n_{MgX2}=\frac{9,5}{24+2M_X}\)
\(n_{X2}=n_{AlX3}.\frac{2}{3}=\frac{8,9}{27+3M_X}.\frac{3}{2}\)
\(\Rightarrow\frac{9,5}{24+2M_X}=\frac{13,35}{27+3M_X}\)
\(\Rightarrow M_X=35,5\left(Cl\right)\)
\(\Rightarrow m=0,1.71=7,1\left(g\right)\)