<s>[INST] If $n\in\mathbb N$ and $4^n+2^n+1$ is prime, prove that there exists an $m\in\mathbb N\cup\{0\}$ such that $n=3^m$. If $n\in\mathbb N$ and $4^n+2^n+1$ is prime, prove that there exists an $m\in\mathbb N\cup\{0\}$ such that $n=3^m$.
I.e. if $4^n+2^n+1$ is prime, prove that $n=3^m$, where $m\in\mathbb N\cup\{0\}$.
I don't know how I could solve this, I don't have any ideas. I know that $4^n+2^n+1$ is obviously odd. Assume $m=0$, i.e. $n=1$. Then $3$ is prime. So that doesn't disprove what we're trying to show.
So assume $m>0$. Then $4^n+2^n+1>3$, so $4^n+2^n+1$ is either $3k+1$ or $3k+2$, where $k\in\mathbb N$. So either $4^n+2^n$ or $4^n+2^n-1$ is divisible by 3. I think it's not something that could help out at solving this. Just a little observation. I don't have any ideas.
 [/INST] Hint. For prime $p\not=3$ we have
$$(x^2+x+1)\mid (x^{2p}+x^p+1)$$
Proof. 

 \begin{align}x^{2p}+x^p+1&=\frac{x^{3p}-1}{x^p-1}\\&=\frac{(x^3-1)\left(\sum\limits_{k=0}^{p-1}x^{3k}\right)}{x^p-1}\\&=\frac{(x^2+x+1)\left(\sum\limits_{k=0}^{p-1}x^{3k}\right)}{(x^p-1)/(x-1)}\end{align} Now it suffices to prove \begin{align}\frac{x^p-1}{x-1}\big|\sum_{k=0}^{p-1}x^{3k}\end{align} Since $x^p\equiv 1\pmod{x^p-1}$, we see $x^{np+j}\equiv x^j\pmod{\frac{x^p-1}{x-1}}$. Now note that since $3\not\mid p$, for $k=0,1,\cdots,p-1$ the sequence $3k$ form a complete residue system of $p$. So \begin{align}\sum_{k=0}^{p-1}x^{3k}&\equiv\sum_{j=0}^{p-1}x^j\pmod{\frac{x^p-1}{x-1}}\\ & \equiv\frac{x^p-1}{x-1}\equiv 0\pmod{\frac{x^p-1}{x-1}}\end{align}

</s>