<span>In bonding with another element, magnesium has an oxidation number of +2. It gives away 2 electrons when it bonds. It will most easily bond with an element that accepts 2 electrons. [ With an oxidation number of -2 that is oxygen, which contains 6 electrons in its valence shell. </span>