The partition function and elliptic curves