information:classification, stylistic:style_transfer
Subshell energies and filling order

Although it is sometimes stated that all the electrons in a shell have the same energy, this is an approximation. However, the electrons in one subshell do have exactly the same level of energy, with later subshells having more energy per electron than earlier ones. This effect is great enough that the energy ranges associated with shells can overlap.

The filling of the shells and subshells with electrons proceeds from subshells of lower energy to subshells of higher energy. This follows the n + ℓ rule which is also commonly known as the Madelung rule. Subshells with a lower n + ℓ value are filled before those with higher n + ℓ values. In the case of equal n + ℓ values, the subshell with a lower n value is filled first.

Because of this, the later shells are filled over vast sections of the periodic table. The K shell fills in the first period (hydrogen and helium), while the L shell fills in the second (lithium to neon). However, the M shell starts filling at sodium (element 11) but does not finish filling till copper (element 29), and the N shell is even slower: it starts filling at potassium (element 19) but does not finish filling till ytterbium (element 70). The O, P, and Q shells begin filling in the known elements, but they are not complete even at the heaviest known element, oganesson (element 118).