<s>[INST] Evaluating $ \prod_{i=1}^n 3^{2^i} + \sum_{i=1}^n 3^{2^{i+1}-1} \prod_{j=i+1}^n 3^{2^j}$ I'm working on difference equations and got stuck on the algebra with this one: 
$$ u_n = \prod_{i=1}^n 3^{2^i} + \sum_{i=1}^n 3^{2^{i+1}-1} \prod_{j=i+1}^n 3^{2^j}$$
I need to simplify this to just a function of n. Any help would be much appreciated. 
 [/INST] 
We  obtain
  \begin{align*}
\color{blue}{\prod_{i=1}^n3^{2^i}}&\color{blue}{+\sum_{i=1}^n3^{2^{i+1}-1}\prod_{j=i+1}^n3^{2^j}}\\
&=3^{2^1+2^2+\cdots+2^n}+\sum_{i=1}^n3^{2^{i+1}-1}\cdot 3^{2^{i+1}+2^{i+2}+\cdots+2^{n}}\\
&=3^{2\left(2^n-1\right)}+\sum_{i=1}^n3^{2^{i+1}-1}\cdot 3^{2^{i+1}\left(2^{n-i}-1\right)}\\
&=3^{2\left(2^n-1\right)}+\sum_{i=1}^n3^{2^{i+1}-1}\cdot 3^{2^{n+1}-2^{i+1}}\\
&=3^{2\left(2^n-1\right)}+3^{2^{n+1}-1}\sum_{i=1}^n1\\
&=\frac{1}{9}3^{2^{n+1}}+\frac{1}{3}3^{2^{n+1}}n\\
&\color{blue}{=(3n+1)3^{2^{n+1}-2}}
\end{align*}

</s>