Partition function and thermodynamic functions