Given $\lambda$ an [integer partition](https://en.wikipedia.org/wiki/Partition_(number_theory)) of $n$, let $h\_{ij}(\lambda)$ denote the [hook length](https://en.wikipedia.org/wiki/Hook_length_formula#Definitions_and_statement) of cell $(i,j)$ in the [Young diagram](https://en.wikipedia.org/wiki/Young_tableau) of $\lambda$.



> 
> Is there a closed formula or a generating function for the following sequence?
> $$f\_n=\sum\_{\lambda\vdash n}\sum\_{(i,j)\in\lambda}(-1)^{i+j}\cdot h\_{ij}(\lambda)$$
> 
> 
> 



Alternating sum of hook lengths: Part I
The hook length $h\_{ij}(\lambda)$ counts the number of boxes directly below or directly to the right of box $(i,j)$. (I picture the Young diagram of $\lambda$ as having the corner $(0,0)$ located in the upper left.) With this in mind, the alternating sum $\sum\_{(i,j)\in \lambda}(-1)^{i+j}h\_{ij}(\lambda)$ can be expanded as a signed sum over all the boxes in $\lambda$. We see that a box $(i,j)$ contributes $+1$ if both $i,j$ are even, $-1$ if both $i,j$ are odd, and $0$ otherwise. Using this description we see that
$$\sum\_{(i,j)\in \lambda}(-1)^{i+j}h\_{ij}(\lambda)=\left\lceil \frac{\lambda\_1}{2}\right\rceil-\left\lfloor\frac{\lambda\_2}{2}\right\rfloor+\left\lceil \frac{\lambda\_3}{2}\right\rceil-\left\lfloor\frac{\lambda\_4}{2}\right\rfloor+\cdots$$
where $\lambda=(\lambda\_1, \lambda\_2, \dots)$.


Now we can use a wonderful formula due to Boulet (Theorem 1 in ["A Four-parameter Partition Identity"](https://arxiv.org/abs/math/0308012)) which tells us (after the appropriate specialization)
$$H(x,q):=\sum\_{\lambda}x^{\sum\_{(i,j)\in \lambda}(-1)^{i+j}h\_{ij}(\lambda)}q^{|\lambda|}=\prod\_{k\geq 1}\frac{(1+xq^{4k-1})(1+xq^{4k-3})}{(1-q^{4k})(1-xq^{4k-2})^2}.$$
In the notation of Boulet, the choices are $a=xq, b=c=q, d=\frac{q}x$ and we reckon
$$\sum\_{(i,j)\in \lambda}(-1)^{i+j}h\_{ij}(\lambda)=\alpha(\lambda)-\delta(\lambda).$$
The generating function $F(q)=\sum\_{n\geq 0}f\_nq^n$ is given by
$$F(q)=\left[\frac{\partial}{\partial x} H(x,q)\right]\_{x=1}$$
therefore we start by computing
$$\frac{\partial}{\partial x} H(x,q)=H(x,q)\sum\_{k\geq 1}\left(\frac{q^{4k-1}}{1+xq^{4k-1}}+\frac{2q^{4k-2}}{1-xq^{4k-2}}+\frac{q^{4k-3}}{1+xq^{4k-3}}\right)$$
and finally setting $x=1$ gives
$$F(q)=\left(\prod\_{k\geq 1}\frac{1}{1-q^k}\right)\cdot\left(\sum\_{n\geq 1}A\_nq^n\right)$$
where $\sum\_{n\geq 1}A\_{n}q^n=\sum\_k\left(\frac{q^{4k-1}}{1+q^{4k-1}}+\frac{2q^{4k-2}}{1-q^{4k-2}}+\frac{q^{4k-3}}{1+q^{4k-3}}\right)$. If we expand this last sum, the terms simplify a little bit to give $\sum\_{n\geq 1}A\_n q^n=\sum\_{k\geq 1}\frac{q^{2k-1}}{1-q^{2k-1}}$.


