Answer
31.1 g
Work Step by Step
Mass of $X$ in the compound= $40.0\,mg-22.5\,mg=17.5\,mg$
Let the atomic mass of element $X$ be $x$.
$17.5\times10^{-3}\,g\,X\times\frac{1\,mol\,X}{x}\times\frac{10\,mol\,O}{4\,mol\,X}\times\frac{16\,g\,O}{1\,mol\,O}=22.5\times10^{-3}\,g\,O$
$\implies \frac{17.5\times5\times16\,g}{x\times2}=22.5$
Or $x=\frac{17.5\times5\times16\,g}{2\times22.5}=31.1\,g $