Answer: most similar o magnesium : strontium
least similar to magnesium : selenium
Explanation:
For formation of a neutral ionic compound, the charges on cation and anion must be balanced. The cation is formed by loss of electrons by metals and anions are formed by gain of electrons by non metals.
Magnesium forms a cation having an oxidation state of +2 called as [tex]Mg^{2+}[/tex] and oxygen forms an anion with oxidation state of -2. Thus they combine and their oxidation states are exchanged and written in simplest whole number ratios to give neutral [tex]MgO[/tex]
Thus an element which will form cation with same oxidation state of +2 will be strontium and form [tex]SrO[/tex].
Lithium and potassium both belong to group 1 and thus will form cations with oxidation state of +1 and form [tex]Li_2O[/tex] and [tex]K_2O[/tex] respectivley.
Selenium is a non metal and thus will form covalent compound with formula [tex]SeO_2[/tex]