How can I find all $x$ such that $1+(x+1)2^x$ is a perfect square? How can I find all $x$ such that $1+(x+1)2^x$ is a perfect square?
I only find that when $x = 4$, the value is $81$ is the square of $9$, but I cannot get a general solution for this. Could anyone help me with that?

Write $(x+1)2^x=n^2-1$ for integers $n,x$.
For $x \leq -1$, notice that $2^{-x}(n^2-1)=x+1\leq 0$, which implies $n^2-1 \leq 0$ (since $2^{-x}>0$) and so $n=0,1$, from which only $n=1,x=-1$ works in the original problem.
For $0 \leq x \leq 4$, we can see that only $x=4$, $n=9$ works (simply inspect the five cases by hand).
For $x \geq 5$, notice that $4 \mid (n-1)(n+1)$, and also $\gcd(n-1,n+1) \mid 2$, so exactly one of terms $n-1$ or $n+1$ is divisible by $2^{x-1}$ (and possibly higher power, but that is not important here) and the other term is divisible by $2$ (and no by higher power of $2$). So either $n-1=d2^{x-1}$ or $n+1=d2^{x-1}$ where $d \geq 1$ is an integer. Either way, $$(x+1)2^x = n^2-1 \geq (d2^{x-1}-2)(d2^{x-1}),$$
and after division by $2^x$ and using $d \geq 1$ we get
$$x+1 \geq (d2^{x-2}-1)d \geq 2^{x-2}-1,$$
impossible for $x \geq 5$ (you can prove the opposite inequality by induction).
