Nuclear pairing energy of dozens of atomic nuclei in nuclear period chart are calculated along the stable line by extracting the swatch at a proton or neutron number interval of 4. Especially, we have studied the rule of pairing energy of the even-even nuclei of O isotopes changing with nucleon number under the relativistic mean-field model, and found, when energy gap Δ is fixed, the magnitude of nuclear pairing energy is related to nuclear shell structure. Thereof we propose a simple method to test closed shell, and further, we conclude that the neutron number N=6 is a new magic number not only in neutron-rich region, but also in proton-rich region of light nuclei.