Find all natural $n$ such that $2^n+2^{2n} +2^{3n}$ has only $2$ prime factors.
I've tried checking the first 6-7 $n$'s on wolframalpha, but I don't see any patterns for even nor odd $n$'s. At first I thought for all odd $n$'s it was divisible by $2,3,7$, but $n=5$ doesn't work ($n=1,3,7$ do work). How are these $n$ found?
$2^n + 2^{2n}+2^{3n} = 2^n(1+2^n + 2^{2n}) = 2^n p^a$ for some prime $p$ and positive integer $a$. Then, $p^a = 1+2^n + 2^{2n}$.
Suppose $a>1$.
If $a$ is even, $a = 2b$, meaning $p^a - 1 = (p^b - 1)(p^b+1) = 2^n(1+2^n)$, which is impossible (you can see that easily). Then $a$ must be odd.
Then, $2^n + 2^{2n}= (p-1)(p^{a-1} + \dots +1)$. $(p^{a-1} + \dots +1)$ must be odd (it is the sum of an odd number of odd numbers), then $2^n | p-1$. But since $p-1 < p^2 + p +1$, you must have $2^n = p-1$, which means $p= 2^n +1= (p^{a-1} + \dots +1)$, an absurd.
So, $a=1$.