Distribution of the partition function modulo m