Some elements of certain groups in the second period resemble with the certain elements of the next higher group in the third period. This is called diagonal relationship.
Similarities between lithium and magnesium:
(i) Both Li and Mg form a nitride Li3N and Mg3N2 by direct combination with nitrogen.
(ii) The oxides, Li2O and MgO do not combine with excess oxygen to form any superoxide.