The partition function modulo 4