The partition function and Hecke operators