Use generating functions to prove that the number of partitions of a positive integer n into parts, each part at most 2, is ⌊n/2 ⌋ + 1
What I have:
since each part is at most 2, I have p(x) = (1+x+x^2+...)(1+x^2+x^4+...) Which is equal to $\frac{1}{1-x}\frac{1}{1-x^2}$ Using fraction decomposition I have $ \frac{1}{2} + \sum_{n=1}^{\infty}((-1)^n + 1 + n)x^n$ . Now I don't know know where to go from here.
$$P(x)=(\underbrace{1+x+x^2+x^3+\cdots}_{\text{#parts of size 1}})(\underbrace{1+x^2+x^4+x^6+\cdots}_{\text{#parts of size 2}})$$ There's no need to simplify $P(x)$ here. Products of monomials straddling both factors and evaluating to $x^n$ are $x^n\cdot1,x^{n-2}\cdot x^2,\dots,x^{n\bmod2}\cdot x^{\lfloor n/2\rfloor}$, so the coefficient of $x^n$ in $P(x)$ is $\lfloor n/2\rfloor+1$, as required.