Questions about a product of trinomials Let $f(n)=1+x^n+x^{2n}$
Let $p(x)$ be $1+x+x^2+x^5+x^7+...$ where the exponents are the pentagonal numbers.
Let $a(n)$ be the sequence of integers such that the coefficients of the series $f(a(1)) f(a(2)) f(a(3))...$ are congruent mod $2$ to the coefficients of $p(x)$
The first few values of $a(n)$ are: $1,5,6,7,9,11,13,17,18,19,23,25$.
Question 1: Is it true that $a(n+1)-a(n)$ always is $1$, $2$, or $4$?
The first few values  of $a(n+1)-a(n)$ are : $4, 1, 1, 2, 2, 2, 4, 1, 1, 4, 2, 4, 1, 1, 4$
I've checked and it is so for the first $900$ elements of the sequence.
Question 2: Is the sequence $a(2)-a(1) , a(3)- a(2) ,  a(4)- a(3),...$ periodic?
 A: Start by noticing that the generating function of pentagonal numbers when working in $\mathbb Z/2\mathbb Z$ is given by
$$p(x)=1+\sum_{k=1}^{\infty}\left(x^{\frac{k(3k-1)}{2}}+x^{\frac{k(3k+1)}{2}}\right)=\prod_{n\geq 1}(1+x^n)=\prod_{n\geq 1}\frac{1}{(1+x^{2n-1})}$$
The first equation comes from Euler's pentagonal number theorem, and the second from Euler's bijection between partitions into distinct parts and partitions into odd parts.
Next we notice that we have a simple telescoping factorization
$$\frac{1}{1+x^m}=\left(\frac{1+x^{3m}}{1+x^m}\right)\left(\frac{1+x^{9m}}{1+x^{3m}}\right)\cdots=\prod_{k\geq 0}f(3^km)$$ 
and applying the previous equation gives us
$$p(x)=\prod_{n\geq 1, k\geq 0}f(3^k(2n-1))=\prod_{k\geq 0}\prod_{(m,6)=1}f(3^km)^{k+1}.$$
Our last ingredient is the fact that mod 2 we have $(x+y)^{\sum 2^{a_i}}=\prod(x^{2^{a_i}}+y^{2^{a_i}})$. Define the set $S$ as the integers which can be written in the form $2^r3^km$ with $(m,6)=1$ and $2^r$ appearing in the binary expansion of $k+1$. Then we have proved:
$$p(x)=\prod_{n\in S}f(n).$$
From here notice that all integers relatively prime to $6$ are in $S$, which bounds the differences between consecutive members by $4$. Next notice that the only way for $3$ to appear as a consecutive difference is if $6k-2$ or $6k+2$ is in $S$ but they are both ruled out by our characterization. Therefore Question 1 has an affirmative answer. With a little more work you can also show that Question 2 has a negative answer.
