Given an integer partition $\lambda=(\lambda\_1,\dots,\lambda\_{\ell(\lambda)})$ of $n$ where $\ell(\lambda)$ is the length of $\lambda$, associate its [conjugate partition](http://mathworld.wolfram.com/ConjugatePartition.html) $\lambda'$. Denote by $\lambda''=\lambda',0$ found by appending one extra zero at the right end of $\lambda'$. Further, define the following two numerics $a(\lambda'')\_j=\lambda\_j''-\lambda\_{j+1}''$ for $j=1,2,\dots,\ell(\lambda')$ and also that 
$b(\lambda'')=\#\{j: a(\lambda'')\_j>0\}$. 


For example, if $\lambda=(4,2,1)$ then $\lambda'=(3,2,1,1)$ and $\lambda''=(3,2,1,1,0)$ and $a(\lambda'')=(1,1,0,1)$ and $b(\lambda'')=3$.



> 
> **QUESTION.** If $n=2^m$ then are these two polynomials equal? 
>  $$\sum\_{\lambda\vdash n}(q-1)^{2b(\lambda'')}q^{n-\ell(\lambda)}
> \prod\_{a(\lambda'')\_j\geq1}\frac{q^{2a(\lambda'')\_j}-1}{q^2-1}=(q-1)(q^{2n-1}-1).\tag1$$
> 
> 
> 


**Remark 1.** To get some motivation, consider dividing the left-hand side of (1) by $(q-1)^2$, for any $n\in\mathbb{N}$. Taking the limit $q\rightarrow1$ in the resulting expression forces $b(\lambda'')=1$ which means the corresponding Young diagram of the partition $\lambda'$ (hence $\lambda$ itself) must be rectangular. Therefore, the final expression equals [the sum of divisors](https://oeis.org/A000203) (arithmetic) function
$$\sum\_{d\,\vert\, n}d.$$ 


**Remark 2.** I also observe that if $q\rightarrow-1$ in (1), then the left-hand side counts the number of ways of writing $n\in\mathbb{N}$ as a sum of two squares, which is [this sequence](https://oeis.org/A004018) $r\_2(n)$. 



An identity for polynomials over partitions
Yes, your identity $(1)$ is true. We can give a proof as follows:


Let's denote the left hand side of your identity $(1)$ by $A\_n(q)$. Starting with the identity
$$\prod\_{i\geq 1}\left(1+\sum\_{r\geq 1}a\_r(x\_1x\_2\cdots x\_i)^r\right)=\sum\_{\lambda}\left(\prod\_{j\geq 1}a\_{\lambda\_j-\lambda\_{j+1}}\right)\left(\prod\_{j\geq 1}x\_j^{\lambda\_j}\right)$$
where $a\_0$ is taken to be $1$, and the $a\_i, x\_i$ are formal variables, we make the substitutions $a\_r=(q-1)^2\frac{q^{2r}-1}{q^2-1}$ for $r\geq 1$, $x\_1=t$ and $x\_i=qt$ for $i\geq 2$. This turns the right hand side into a generating function for the $A\_n(q)$ where $A\_0(q)$ is taken to be $1$. More specifically it gives
$$\sum\_{n\geq 0}A\_n(q)t^n=\prod\_{i\geq 1}\left(1+(q-1)^2\sum\_{r\geq 1}\frac{q^{2r}-1}{q^2-1}(q^{i-1}t^i)^r\right)=\prod\_{i\geq 1}\frac{(1-q^it^i)^2}{(1-q^{i-1}t^i)(1-q^{i+1}t^i)}$$
$$=(1-q)\frac{(qt;qt)^2\_{\infty}}{(t;qt)\_{\infty}(q;qt)\_{\infty}}.$$
This final product has a Hecke-Rogers type expansion that was given by Andrews in ["Hecke modular forms and the Kac-Peterson identities"](https://www.ams.org/journals/tran/1984-283-02/S0002-9947-1984-0737878-3/) (see Lemma 1).Using this expansion we get
$$\sum\_{n\geq 0}A\_n(q)t^n=(1-q)\sum\_{N\in \mathbb Z, r\geq |N|}(-1)^{r+N}q^{-N}(qt)^{\frac{(r+N)(r-N+1)}{2}}$$
and if we focus on $n=2^m$ we notice that the only way we can have $(r+N)(r-N+1)=2^{m+1}$ is if $(r,N)=(2^m,2^m)$ or $(r,N)=(2^m, 1-2^m)$. This means that $$A\_{2^m}(q)=(1-q)(1-q^{2^{m+1}-1})$$
as desired. The observations in the remark can also be deduced from this last summation.


