Determine all pairs of positive integers $(x,n)$ which satisfy the condition $$x^3+2x+1=2^n.$$
My work so far:
No solution exists for $n=1$. For $n=2$ we get $x=1$.
We show that no solutions exist for $n\ge3$. Suppose that $n \ge 3$. Obviously, $x$ is odd. Then $x^2+2\equiv 3 \pmod 8$. As with the original equation $x(x^2+2)\equiv -1 \pmod 8$, then $x\equiv 5\pmod 8$.
I can not get a contradiction.