When is $2^n -7$ a perfect square?

2k Views Asked by At

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.

2

There are 2 best solutions below

0
On BEST ANSWER

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:

  • one originally due to Hasse
  • another by Wells Johnson

I believe all proofs make use of unique factorization in the ring of integers of $\mathbb{Q}(\sqrt{-7})$.

0
On

So, there were just a few solutions to $2^n = x^2 + 7.$

The other side is, for $n \geq 3,$ there is always a solution to $$ 2^n = x^2 + 7 y^2 $$ with $\gcd(x,y)=1.$ Proof by induction; as I recall, to keep the gcd thing, we demand that $x \equiv y \equiv 1 \pmod 4$ for all $n,$ which sometimes requires $x$ or $y$ or both to be negative. Note that it would not be impressive if we allowed $x,y$ even, because doubling both $x,y$ just adds $2$ to $n.$

I'm just saying.