A theoretical model of atomic nuclei concentrating on the atom-like discrete energy levels of individual protons and neutrons in a time-averaged nuclear potential well. This model explains the stability of nuclei with magic numbers of neutrons and protons.