The nonlinear relativistic mean-held theory is used to investigate the
ground state properties of Mg isotopes from the proton-drip-line nucl
eus Mg-20 to the neutron-drip-line nucleus Mg-40, covering three magic
numbers N = 8, 20, and 28. Special emphasis is placed on the influenc
e of the pairing correlation on the deformation. Calculations show tha
t the relativistic mean-field theory provides a good description of th
e binding energy and the root-mean-square radius of charge distributio
ns. A monotonic increase of the neutron skin thickness with neutron ex
cess is predicted. The nuclear shell structure at magic numbers N = 8,
20, and 28 is discussed.