Answer
$Mg(ClO_4)_2$
Work Step by Step
We know that $ClO_4$ has a -1 charge and that Mg has a +2 charge. Thus, to write the formula for the compound, pick the smallest ratio of the cation and the anion that will make the overall molecule neutral.