# Partitions into parts differing by 2

If we look at the difference between the number of partitions of $n$ with distinct parts that have an even number of parts and the number of partitions of $n$ with distinct parts that have an odd number of parts we get Euler's pentagonal theorem. What happens when we look at the difference between the number of partitions of $n$ with parts differing by at least 2 that have an even number of parts and the number of partitions of $n$ parts differing by at least 2 that have an odd number of parts. Is this difference limited some way? Is it ever bigger in absolute value than one? Are there known upper or lower bounds as n goes to infinity?

As for the generating function - what I managed to get is a very strange "downside-up continued fraction" $$1-q-q^2\frac{1-q^2-q^4\frac{1-q^3-q^6 \frac{1-q^4-q^8\frac{ 1-q^5-q^{10}\frac{1-q^6-q^{12}\cdots}{1-q^5}}{1-q^4}}{1-q^3}}{1-q^2}}{1-q}$$ Looks like it is A039924, in which case this generating function is equal to $$1-\frac q{1-q}+\frac{q^4}{(1-q) \left(1-q^2\right)}-\frac{q^9}{(1-q) \left(1-q^2\right) \left(1-q^3\right)}+...$$
• I used quick and dirty Mathematica code ListPlot[Table[With[{l = Select[IntegerPartitions[n], Max[Differences[#]] < -1 &]}, 2Length[Select[l, EvenQ@*Length]] - Length[l]], {n, 50}], Joined -> True], surely it can be done much better Mar 15 '16 at 21:58