Let $n$ be a natural number. $4^n+2^n+1$ is a prime. Then, show that $n$ is a power of $3$.
My attempt:
Let $4^n+2^n+1=p$ where, $p$ is a prime. Hence, $(2^n)^2+2^n+1-p=0$ which gives
$2^{n+1}=-1 \pm \sqrt{4p-3}$.
How should I proceed after this? As of now, I can't see how I can say that $n$ is a power of $3$ if I proceed in this manner.
Any constructive hint is appreciated.