# Is there a limiting case for this sequence of infinite product representations for the theta function?

Starting from the famous infinite product $$(1+z)^2(1-z^2)(1+z^3)^2(1-z^4)(1+z^5)^2(1-z^6)\cdots=1+2z+2z^4+2z^9+2z^{16}+\dots$$ it is easy to show by induction that $$\prod_{k\geqslant1}\left((1-z^k)(1-z^{2k-1})^N(1+z^{2k})^{N+1}(1+z^{2k-1})^{N+3}\right)=\sum_{n=-\infty}^{+\infty}z^{n^2}$$ for any $N\geqslant0$.

Can one give sense to passing to the limit w. r. t. $N\to\infty$ and if yes what does one obtain?

A by-question: it seems that this also holds for all negative $N$ but I somehow cannot prove it, is it true?

The point is that there is another very well known infinite product identity $$P(t):=\prod_{k\geqslant 1}\left((1-t^{2k-1})(1+t^k)\right)=1;$$ and the lhs in the needed equality is $$P(z^2)^N\prod_{k\geqslant1}\left((1-z^k)(1+z^{2k})(1+z^{2k-1})^3\right),$$ so $P(z^2)^N$ is $1$ while the terms in the product can be easily regrouped to get $$\prod_{k\geqslant1}\left((1-z^{2k-1})(1-z^{2k})(1+z^{2k})(1+z^{2k-1})^3\right) =\prod_{k\geqslant1}\left((1-z^{4k-2})(1-z^{4k})(1+z^{2k-1})^2\right) =\prod_{k\geqslant1}\left((1-z^{2k})(1+z^{2k-1})^2\right)$$ which by the very first equality the question starts with is $\sum_{n\in\mathbb Z}z^{n^2}$.
Thus indeed this works for any $N$ (not just any integer but any number at all).