2^n+1 = m^2

1. Apr 30, 2005

T.Rex

Hi,
I'm looking to solutions of: $$2^n+Q=m^2$$ , where $$Q=1$$ .
Obviously, n must be odd.
I already know the trivial solution: $$2^3+1=3^2$$ and I've started using a naive PARI/gp program for finding (n,m) up to n=59 . No success yet.

This is related to Pell numbers $$(P,Q)=(2,-1)$$ and to a series of Prime numbers studied by Newman, Shanks and Williams, called NSW numbers, and generated by: $$(P,Q)=(6,1)$$ .
The idea is to have $$D=P^2-4Q=2^n$$ and $$Q=\pm 1$$ .
Since Mersenne numbers are square-free, (2,-1) is the unic solution for Q=-1.
About Q=1, I don't know ...

Tony

2. Apr 30, 2005

Zurtex

Well I don't know the solution, but this is how I would look at it. First of all we are looking at odd numbers, although before we do I would like to mention:

$$2^0 + 1 = 1^2$$

Right so the from we have is:

$$2^{2m + 1} + 1 = 2 \cdot 2^{2m} + 1 = 2 \cdot \left( 2^m \right)^2 + 1 = 2a^2 + 1 = p^2$$

So you are looking for the integer solutions of:

$$2 a^2 + 1 = p^2 \quad \text{where:} \quad a = 2^m \quad m, \, p \, \in \mathbb{N}$$

Now, it's not too difficult to deduce from that that p must be odd. Not only that but p - 1 must be twice another square number. Hence:

$$p^2 = \left(2q + 1\right)^2 = 4q^2 + 4q + 1$$

So:

$$2q^2 + 2q = a^2$$

$$q^2 + q = 2^{2m - 1}$$

$$q(q + 1) = 2^{2m - 1}$$

Which is a contradiction for q > 1. Now look at q = 1, which is p=3 and your solution.

Last edited: Apr 30, 2005
3. Apr 30, 2005

T.Rex

Thanks !

Thanks ! That proves that (n,p)=(3,3) is the unic solution of $$2^n+1=p^2$$.
Thanks to your proof, I think I have something shorter:
$$2^n+1=p^2 \leftrightarrow 2^n=(p-1)(p+1)$$ .
In order to have both $$p-1=2^\alpha$$ and $$p+1=2^\beta$$, it is clear that there is only 1 solution: $$p=3$$ .

Thanks !
Tony