<s>[INST] If $1+2^n+4^n$ is prime number then prove that $n=3^k$ for some $k\in \mathbb{N}$. If $1+2^n+4^n$ is prime number then prove that $n=3^k$ for some $k\in \mathbb{N}$.
I've looked at https://math.stackexchange.com/a/186723/283318 for an inspiration. In base 2, $1+2^n+4^n=10\ldots010\ldots01$ and I am completely stuck. 
 [/INST] If $n$ is even, then $3\mid 1+2^n+4^n$, so if $1+2^n+4^n$ is prime, then $1+2^n+4^n=3$, so $n=0$.
If $n$ is odd, for contradiction assume $n=3^kr$ for some $r\ge 2,\, \gcd(r,6)=1$.
$$\left(2^n-1\right)\left(4^n+2^n+1\right)=2^{3n}-1=2^{3^{k+1}r}-1$$
$$=\left(2^{3^{k+1}}-1\right)\left(2^{3^{k+1}r-3^{k+1}}+2^{3^{k+1}r-3^{k+1}-1}+\cdots+1\right)$$
$$\implies 2^{3^{k+1}}-1\mid \left(2^{3^kr}-1\right)\left(4^n+2^n+1\right)$$
But $\gcd\left(2^{3^{k+1}}-1,2^{3^{k}r}-1\right)=2^{3^k}-1$ (see here why).
$$\implies \frac{2^{3^{k+1}}-1}{2^{3^k}-1}\mid 4^n+2^n+1$$
$$\iff 4^{3^k}+2^{3^k}+1\mid 4^n+2^n+1$$
But $4^{3^k}+2^{3^k}+1< 4^n+2^n+1$, so $4^n+2^n+1$ cannot be prime.
</s>