That's right-- because of the way that energy is distributed within the orbitals, there isn't a constant progression of orbital filling. The pattern seems random, but there is an underlying order to it.
The principle quantum number (the first number you read) tells what
shell the orbital lies in, i.e., how far away from the nucleus it is. In general, the larger the number, the more energy in the shell.
Each shell, however, contains several different
orbitals. The energy of a given orbital depends on its shape. There are four different orbital shapes. The
s orbital is simply a sphere. This is the lowest energy state for any given shell. The
p orbitals are shaped somewhat like 3 barbells at right angles to each other and are more energetic than the s orbital of the same shell.
Next comes the
d orbital. This is where things start to get intersesting. Beginning with orbital 3d, the d orbitals have so much energy inherent in their shape that they actualy have
more energy than the lowest orbital of the shell above them. An atom always tries to be in the lowest possible energy state, so once its 3p orbital is full, it opts to begin filling the 4s orbital instead of moving on to the more energetic 3d configuration. A similar thing happens after the 5s orbital is filled, where, because of the need for a lower energy state, the atom moves to the 4d instead of the 5p orbital you would expect.
These energy discrepancies between shells become more and more pronounced as you move up the list of elements, as can be seen in the list I posted above.
The d and
f orbitals have very complex shapes, and are best seen in
graphical form.
I hope this helps,
--Rabk