This is a question in the spirit of an earlier problem.

Let $\lambda$ be an integer partition: $\lambda=(\lambda_1\geq\lambda_2\geq\dots\geq0)$.

Recall also the notation for the content of a cell $u=(i,j)$ in a partition: $c_u=j−i$. Further, let $h_u$ denote the hook-length of the cell $u$.

The below identity is rather cute for which I don't remember a reference or a proof, so here I ask.

Identity.Given a partition $\lambda\vdash n$, it holds that $$\sum_{u\in\lambda}h_u^2=n^2+\sum_{u\in\lambda}c_u^2.$$

For example, if $\lambda=(4,3,1)\vdash 8$ then the hooks are $\{6,4,3,1,4,2,1,1\}$ and the contents are $\{0,1,2,3,-1,0,1,-2\}$. Hence \begin{align} LHS=6^2+4^2+3^2+1^2+4^2+2^2+1^2+1^2&=84 \\ RHS=\mathbf{8^2}+0^2+1^2+2^2+3^2+(-1)^2+0^2+1^2+(-2)^2&=84. \end{align}