Magnetic moments of nuclei with closed j-j shells plus or minus one nucleon