Combinatorial proof of the formula for hook-length Let $\lambda=(\lambda_1,...,\lambda_n)$ be a partition. My goal is to prove the following formula
$$\sum\limits_{x\in\Lambda}(h(x)^2-c(x)^2)=|\lambda|^2,$$
where for $x=(i,j)\in\Lambda:=\{(i,j)\in\mathbb{Z}^2 :\ 1\le j\le \lambda_i \}$ we define
$$h(x)=\lambda_i+\lambda_j'-i-j+1,$$
$$c(x)=j-i,$$
$$|\lambda|=\lambda_1+...+\lambda_n,$$
and $\lambda_j'=\mathrm{card}\{j: \ \lambda_j\ge i\}$.
I did it by a straightforward calculation (using induction), but I found an information that it is possible to do it in a purely combinatorial way. I will be very grateful for any hint how to see this formula without tedious calculations.
 A: Initialize a counter $c_{i,j} ← 0$ for each $(i, j) ∈ Λ$. Then for each ordered pair $((i_0, j_0), (i_1, j_1)) ∈ Λ^2$:

*

*If $(i_0 - i_1)(j_0 - j_1) < 0$, increment $c_{\min \{i_0, j_0\}, \min \{i_1, j_1\}}$ by $1$.

*If $(i_0 - i_1)(j_0 - j_1) > 0$, increment $c_{\max \{i_0, j_0\}, \max \{i_1, j_1\}}$ by $1$.

*If $(i_0 - i_1)(j_0 - j_1) = 0$, increment $c_{{i_0, j_0}}$ by $i_1 + j_1 - i_0 - j_0 + \frac12$, and increment $c_{i_1, j_1}$ by $i_0 + j_0 - i_1 - j_1 + \frac12$.

In total, each $c_{i,j}$ was incremented by

*

*$2(λ'_j - i)(λ_i - j)$ from pairs with $(i_0 - i_1)(j_0 - j_1) < 0$,

*$2(i - 1)(j - 1)$ from pairs with $(i_0 - i_1)(j_0 - j_1) > 0$,

*$2λ'_j\left(\frac{λ'_j + 1}{2} - i + \frac12\right) + 2λ_i\left(\frac{λ_i + 1}{2} - j + \frac12\right) - 2·\frac12$ from pairs with $(i_0 - i_1)(j_0 - j_1) = 0$.

Adding these, we see that $c_{i,j}$ simplifies to exactly $h(i,j)^2 - c(i, j)^2$. But the sum of all counters must be $|λ|^2$ since we increased it by $1$ from each pair.
