Stanley defined a partition function $t(n)$ as the number of partitions $\lambda$ of $n$ such that the number of odd parts of $\lambda$ is congruent to the number of odd parts of the conjugate partition $\lambda'$ modulo $4$. We show that $t(n)$ equals the number of partitions of $n$ with an even number of hooks of even length. We derive a closed-form formula for the generating function for the numbers $p(n)-t(n)$.  As a consequence, we see that $t(n)$ has the same parity as the ordinary partition function $p(n)$. A simple combinatorial explanation of this fact is also provided.
['William Y. C. Chen', 'Kathy Q. Ji', 'Albert J. W. Zhu']
On Stanley's Partition Function