Beryllium
Elements with the same chemical properties have the same number of electrons in their highest occupied shell. Magnesium has two electrons in its highest occupied shell, and the only element with two electrons in its highest occupied shell and less total electrons than magnesium is beryllium