Partition Function

What
The partition function is simply the weighted sum of the number of ways the atom can arrange its electrons with the same energy, with more energetic (and therefore less likely) configurations receiving less weight from the Boltzmann factor when the sum is taken

$$Z = \sum _{j=1} ^\infty g_j e^{-(E_j - E_1)kT}$$