Can you make an identity from this product?

Possible answers: $$ \left(1+x+x^2\right) \prod_{i=2}^{+\infty} \left(1 - (-1)^i x^i \right) $$ and $$ \left(1-x+x^2\right) \prod_{i=2}^{+\infty} \left(1 - x^i \right) $$


Proof of Doriano Brogloli's answer:

Call $a(n)$ the $n$th coefficient of $A(x)=(1-x)(1-x^2)\cdots$. By Euler's pentagonal theorem we have $a(n)=0$ unless $n=m(3m\pm1)/2$ for some $m$, in which case $a(m)=(-1)^m$. Call $b(n)$ the $n$th coefficient of $B(x)=(1-x^2)(1-x^3)...$. Since $A(x)=(1-x)B(x)$ we have $b(n)-b(n-1)=a(n)$, so $b(n)=\sum_{0\le j\le n}a(j)$. Now for any integer $n$ there exists a unique $m$ such that $(m-1)(3(m-1)+1)/2\le n<m(3m+1)/2$. If $(m-1)(3m-2)/2\le n<m(3m-1)/2$ we thus have $b(n)=1+2\sum_{1\le j\le m-1}(-1)^j=(-1)^{m-1}$, and if $m(3m-1)/2\le n<m(3m+1)/2$ we have $b(n)=(-1)^{m-1}+(-1)^m=0$.

Finally, we have $C(x)=(1-x+x^2)(1-x)(1-x^2)\cdots=A(x)+x^2B(x)$ so its $N+2$th coefficient $c(N+2)$ is equal to $a(N+2)+b(N)$. Thus, if $(m-1)(3m-2)/2\le N<m(3m-1)/2$ but $N\ne m(3m-1)/2-2$ we have $c(N+2)=(-1)^{m-1}$, while if $N=m(3m-1)/2-2$ we have $c(N+2)=(-1)^{m-1}+(-1)^m=0$, and if $m(3m-1)/2\le N<m(3m+1)/2$ but $N\ne m(3m+1)/2-2$ we have $c(N+2)=0$, while if $N=m(3m+1)/2-2$ we have $c(N+2)=(-1)^m$.


I made a mistake in my initial answer, apologies, I tested for all coefficients instead of stopping at the first $n_{\rm max}$ and thought I found a violation at $n_{\rm max}=9$. With the corrected code I find a solution for each $n_{\rm max}$ I could check.


This Mathematica codes tests if the coefficients of $x^p$ with $p\leq n_{\rm max}$ of the polynomial $$(1+\sigma_1 x+\sigma_2 x^2)\prod_{n=2}^{n_{\rm max}}(1+\sigma_{n+1}x^n)$$ are in $\{-1,0,1\}$. The test is performed for each of the $2^{n_{\rm max}+1}$ choices of signs $\sigma_i=\pm 1$.

nmax = 9; 
s = Tuples[{-1, 1}, nmax + 1];  
list = Table[CoefficientList[(1 + s[[i, 1]]*x + s[[i, 2]]*x^2)*
             Product[(1 + s[[i, n + 1]]*x^n), {n, 2, nmax}], x],
                                               {i, 1, 2^(nmax + 1)}]; 
Table[AllTrue[list[[i, 1;;nmax]], Abs[#] < 2 &], {i, 1, 2^(nmax + 1)}] // Sort