Odd-minus-even hook count of a partition (source code)

= Odd-minus-even hook count of a partition

Removing a rim hook of length two preserves the number of odd hook lengths minus the number of even hook lengths. If the 2-core is the staircase $(r,r-1,\ldots,1)$, every one of its $r(r+1)/2$ hooks is odd. Hence the difference for the original partition is
$$
\binom{r+1}{2}.
$$