Regularity of electron configuration for heavier atoms
Yes, the nucleus has a complex structure, too.  The most basic evidence for this comes in the existence of patterns in which nuclei are most stable, which manifests itself in the decay lifetime and to some extent in the cosmic abundance of isotopes.  I don't think there is any reflection of it in the electronic structure: from the point of view of the electrons, the nucleus is pretty much just a point positive charge.  The patterns in the electron configuration you are noticing are due to the Pauli exclusion principle and the various ways quantum mechanical particles can fit into a spherical potential well.   You can find a description in any basic general chemistry textbook, and the math will be developed in any undergraduate physical chemistry textbook.

You can get started on nuclear structure by googling "nuclear shell structure."  That will lead you to very basic introductions, e.g. on Wikipedia or Hyperphysics, and you can decide where to go from there.  I don't know any textbooks that treat it simply, because the assumption is that if you are interested in the nuclear physics of nuclei you are already very familiar with the quantum mechanics of electrons.