4s and 3d orbitals

For elements in the first three periods of the periodic table (hydrogen - argon), the orbitals can simply be filled up by increasing energy energy level. 

A difficulty arises when we come to potassium. Potassium has an atomic number of 19.

The first 18 electrons can occupy the 1s, 2s, 2p, 3s and 2p orbitals: 1s2 2s2 2p6 3s2 3p6. Where does the final electron go?

It would seem to make perfect sense to place the electron within the 3d orbitals. However, we find that the last electron enters the 4s orbital giving the overall electrons configuration: 1s2 2s2 2p6 3s2 3p4s1. This is very surprising since we assume the 4th energy level is higher in energy that the 3rd energy level. However, reality is more complex. 

INSERT[UUPT_DMA_CI07_ima - image of orbital energy]

For potassium and calcium, the 4s orbital dips in energy below the 3d orbitals, and so electrons go into the 4s orbital before occupying the 3d orbitals. 

Consequently, potassium and calcium have the following electon configurations.

Potassium: 1s2 2s2 2p6 3s2 3p6 4s1

Calcium: 1s2 2s2 2p6 3s2 3p6 4s2

Writing out all the orbitals can be a bit laborious and so a frequent shorthand way is to write the electron configurations of potasisum and calcium as: [Ar] 4s1 and [Ar] 4s2 respectively, where [Ar] represents the electron configuration of argon.
 

 
This is new version