Some of the intriguing questions related to the physics of exotic nuclei are how their shell structure changes with respect to that of nuclei close to the line of beta-stability and what mechanisms are responsible for that.
I will discuss the systematic studies of the variations of the nuclear mean field in a series of isotopes or isotones, adjacent to semi-magic nuclei, within the nuclear shell model. We make use from the very accurate approximate expression for the shell-model centroids of the single-particle states in these nuclei incorporating the monopole part of the residual proton-neutron interaction and the pairing correlations among identical nucleons. In this way we are able to treat heavy systems which at present cannot be studied by exact diagonalization. The approach is applied to explore the evolution of the mean field in a series of F, Cu, Sb and Bi isotopes and N=29 and N=51 isotones. The changes of the single-particle energies are shown to be mainly due to the monopole part of the effective two-body interaction. The comparison between different schematic and realistic forces is performed in an attempt to understand the role of specific terms acting within the effective interaction.