This came up while solving another ENT problem. I want to ask when is: $$2^n -7 \text{ where } n\geq 3$$ a perfect square? Specifically, I also wanted to know what would be the solutions when $n$ is odd? How should I solve this?
I can check that $n=3, 4, 7$ are solutions but cannot find more. As it is of the form $4k+1$, it doesn't help as well.
The equation $$2^n-7=x^2$$ is called the Ramanujan–Nagell equation. It has been conjectured by Ramanujan and proven by Nagell, and later others, that the only solutions are $n=3,4,5,7$ and $15$. Here are two proofs:
I believe all proofs make use of unique factorization in the ring of integers of $\mathbb{Q}(\sqrt{-7})$.