This is an off-shot from my previous post on MO.

Given an integer partition $\lambda=(\lambda_1,\dots,\lambda_{\ell(\lambda)})$ of $n$, denote $\ell(\lambda)$ to be the length of $\lambda$.

Let $r_2(n)$ denote the number of ways of expressing $n$ as a sum of two squares of integers, look it up on OEIS.

Here is perhaps a "new formulation" of $r_2(n)$:

QUESTION.Is this true? If it is, please either provide a reference or a proof. $$r_2(n) =\sum_{\lambda\vdash n}(-1)^{n-\lambda_1}{\prod_{j=1}^{\ell(\lambda)}} \,4\,(\lambda_j-\lambda_{j+1})$$ where $\lambda_{\ell(\lambda)+1}=0$ and the product excludes $\lambda_j=\lambda_{j+1}$.

**Example.** Take $n=4$. The solutions to $4=x^2+y^2$ are $(\pm2,0), (0,\pm2)$ and hence $r_2(4)=4$. On the other hand, $\lambda=(4,0), (3,1,0), (2,2,0), (2,1,1,0), (1,1,1,1,0)\vdash 4$ so that
$$(-1)^{4-4}4\cdot4+(-1)^{4-3}4\cdot2\cdot4\cdot1+(-1)^{4-2}4\cdot2
+(-1)^{4-2}4\cdot1\cdot4\cdot1+(-1)^{4-1}4\cdot1=4.$$