Arithmetic of the Partition Function