<s>[INST] Finding coefficient of $ x^{2017}$ in expansion of $(x +1+\frac{1}{x})(x^3 + 1 + \frac{1}{x^3})...(x^{2187} + 1 + \frac{1}{x^{2187}})$ I notice that $3^7=2187$ and this implies there are 8 terms in product.
The presence of $x^3$ and its powers gives a slight possible hint that $\omega$ might do some trick. But I don't see how.Other things I thought was ${2017}$  leaved remainder 1 when divided by 3 so maybe finding coefficient of  $x$,$x^4$ may help. and I multiplied the first two terms to see that all the powers of x occurred. I am thinking many ideas but none of them are solving the problem,also it looks like the answer maybe 1.Probably the only reason why we are finding coefficient of $x^{2017}$ because this year is 2017.I can't solve it directly by observation.
Please suggest some method and see where I am lacking.       
 [/INST] A nice example of  telescoping products. It is  convenient to  use  the coefficient of  operator $[x^n]$ to denote the coefficient of $x^n$ in a series.

We obtain
  \begin{align*}
\color{blue}{[x^{2017}]\prod_{j=0}^7\left(\frac{1}{x^{3^j}}+1+x^{3^j}\right)}
&=[x^{2017}]\prod_{j=0}^7\frac{1+x^{3^j}+\left(x^{3^j}\right)^2}{x^{3^j}}\\
&=[x^{2017}]\prod_{j=0}^7\frac{1-x^{3^{j+1}}}{x^{3^j}\left(1-x^{3^j}\right)}\tag{1}\\
&=[x^{2017}]\frac{1}{x^{\sum_{j=0}^{7}3^j}}\prod_{j=0}^7\frac{1}{1-x^{3^j}}\prod_{j=1}^8\left(1-x^{3^j}\right)\tag{2}\\
&=[x^{2017}]x^{-\frac{1}{2}\left(3^8-1\right)}\frac{1-x^{3^8}}{1-x}\tag{3}\\
&=[x^{5297}]\sum_{j=0}^{3^8}x^j\tag{4}\\
&\color{blue}{=1}
\end{align*}

Comment:


*

*In (1) we use of $(1+y+y^2)(1-y)=1-y^3$ with  $y=x^{3^j}$.

*In (2) we  factor out $\prod_{j=0}^7x^{3^j}$, seperate numerator and denominator and shift the index of the right product by one to better see the telescoping property.

*In (3) we apply the finite geometric series formula and cancel terms thanks to telescoping.

*In (4) we note that $\frac{1}{2}\left(3^8-1\right)=3280$ and apply the rule $[x^p]x^{-q}A(x)=[x^{p+q}]A(x)$. We also expand the geometric power series and see finally the coefficient of $x^{5297}$ is equal to $1$.
</s>