I have the following question, I'm not sure how to do :
Let $a_n$ be the number of partitions of $n$ in which no part occurs exactly once and no part occurs exactly three times. For instance with $n = 19$ then $3^2 2^4 1^5$ is such a partition.
Consider generating function
$$A(t)=\sum_{n\ge 0}a_n t^n\;.$$
prove that
$$A(t)=\prod_{k\ge 0}\frac{1-t^k+t^{2k}-t^{3k}+t^{4k}}{1-t^k}\;.$$
The generating function for the total number of partitions is $$P(x)=(1+x+x^2+\dots)(1+x^2+x^4+\dots)(1+x^3+x^6+\dots)\dots=\prod_{k\ge 0} \frac{1}{1-x^k}.$$
To illustrate why this is, consider the partition $3^22^41^5$ and multiply together the second term (under the convention that the zeroeth term is $1$) in the third bracket $(x^6)$, the fourth term in the second bracket $(x^8)$, and the fifth term of the first bracket $(x^5)$. This product is $x^{19}$. Can you now see why the $x^{19}$ coefficient of $P(x)$ is the number of partitions of $19$?
So you should by now have guessed that $$A(t)=(1+t^2+t^4+t^5+t^6+\dots)(1+t^4+t^8+t^{10}+\dots)(1+t^6+t^{12}+t^{15}+\dots)\dots.$$
This can be simplified to \begin{align} A(t)&=\left(\frac{1}{1-t}-(t+t^3)\right)\left(\frac{1}{1-t^2}-(t^2+t^6)\right)\left(\frac{1}{1-t^3}-(t^3+t^9)\right)\dots\\ &=\prod_{k\geq 0}\left(\frac{1}{1-t^k} - (t^k+t^{3k})\right)\\ &=\prod_{k\geq 0}\frac{1-t^k+t^{2k}-t^{3k}+t^{4k}}{1-t^k} \end{align}