9

$$p+1=2n^2$$$$p^2+1=2m^2$$ Find positive integers $m,n$ and prime $p$ satisfying the above two equations.

What would people commonly do?

Subtracting both the equations.

You get:

$$p(p-1)=2(m-n)(m+n)$$

If you notice carefully, the above equation has infinitely many solutions, and this doesn't work because the generality of the equation is lost when you subtract both of them.

I noticed that $p \equiv -1 \pmod 8$. $p=7$ works fine. I don't see any other solution, but not able to contradict of existence.

Inceptio
  • 7,881
  • Do you really mean "find positive integers...", or do you mean "find all positive integers..."? – Chris Eagle Jul 13 '13 at 09:09
  • 3
    If you eliminate $p$ from the two equations, you get $m^2$ equal to a quartic in $n$. Such are known to have only finitely many integer solutions, but finding them all can be tricky. What's the source? – Gerry Myerson Jul 13 '13 at 09:11
  • @GerryMyerson: If you eliminate $p$, you are not talking about primes anymore in the question. – Inceptio Jul 13 '13 at 09:12
  • @ChrisEagle: I mean 'all +ve integer solutions'. – Inceptio Jul 13 '13 at 09:12
  • 1
    If there are only finitely many solutions, then there are only finitely many solutions where $p$ is prime. – Gerry Myerson Jul 13 '13 at 09:13
  • 1
    @Inceptio What makes you think there will be an easier way of finding the prime solutions than finding all the solutions and picking out the ones which are prime? – Mark Bennet Jul 13 '13 at 09:14
  • @MarkBennet: We can analyse with some clever $\pmod n$? – Inceptio Jul 13 '13 at 09:18
  • 1
    Why shouldn't $p$ be $1$ mod $8$? – Chris Eagle Jul 13 '13 at 09:20
  • 2
    Note that the integer solutions to $r^2\pm 1=2s^2$ are the successive convergents to the continued fraction for $\sqrt 2$ - which is a useful fact to know for contests. These are formed by setting $a_0=1, b_0=1; a_r=a_{r-1}+2b_{r-1}, b_r=a_{r-1}+b_{r-1}$ giving the pairs $(1,1), (3,2), (7,5), (17,12), (41,29) \dots$ - alternate ones give the sign you need. – Mark Bennet Jul 13 '13 at 09:20
  • @ChrisEagle The quasi-solution $p=1$ shows that $1 \mod 8$ cannot be eliminated as a possibility on the grounds of congruence alone. – Mark Bennet Jul 13 '13 at 09:35
  • At the risk of repeating myself, WHAT'S THE SOURCE? – Gerry Myerson Jul 13 '13 at 12:18
  • @GerryMyerson: It is from a Contest problems book. – Inceptio Jul 13 '13 at 12:50
  • 1
    @Inceptio: Does this book have a name? An author, maybe? – Chris Eagle Jul 13 '13 at 13:04
  • @ChrisEagle: Problem Primer for Olympiad by Pranesachar. I'm afraid it isn't available online. – Inceptio Jul 13 '13 at 13:11
  • 1
    This problem also appeared on a Belgian university mathematics competition, see http://olympia.problem-solving.be/node/2012. (This is in Dutch, but you can see it is the same problem.) – Bart Michels Jul 14 '13 at 08:17
  • See also http://math.stackexchange.com/questions/874590/find-all-integer-solutions-of-1xx2x3-y2 – Gerry Myerson Jul 23 '14 at 07:02

4 Answers4

5

Here's Mahoney's proof [p.338].

Let $(u_0,w_0)$ be a solution of $$2U^2-W^2=p. \tag{1}$$ Then $$(u_1,w_1) = (2u_0^2 \pm 2u_0w_0 + w_0^2,2u_0^2\pm 4u_0w_0 + w_0^2)$$ is a solution of $2U^2-W^2=p^2.\tag{2}$ If, moreover, $(u_0,w_0)$ is the least solution of (1), then $(u_1,w_1)$ with the minus sign is the least solution of (2). Therefore suppose $2u_0^2-1=p$. Then $$(u_1,w_1)=(2u_0^2-2u_0+1,2u_0^2-4u_0+1)\tag{$\star$}$$ is a solution of (2). But clearly $(u_0,1)$ is the least solution of (1); hence $(\star)$ gives the least solution of (2). By assumption, we have $w_1 = 1 = 2u_0^2-4u_0+1$, so $u_0=2$, and $(2,1)$ is the only solution of (1). Hence $p=7$.

Kieren MacMillan
  • 7,889
  • 2
  • 28
  • 70
3

Yes, $p=7$ is the only solution. Given a prime $p$ as above, you obtain a Pythagorean triple, setting $a=2nm$, $b=n^2-m^2$ and $c=n^2+m^2$, which gives $$ (p^3+p^2+p+1)+ \left( \frac{p^2-p}{2}\right)^2=\left( \frac{p^2+p+2}{2}\right)^2. $$ By the way, for $p=7$ we obtain $20^2+21^2=29^2$.
The condition, that $p^3+p^2+p+1$ is a square implies that $p=1$ or $p=7$ (not only for primes, but for all positive integers). In fact, the solution is given in Ribenboim's book on Catalan's conjecture, where all equations $y^2=1+n+n^2+\cdots +n^k$ are studied. For $k=3$, only $1$ and $7$ are possible.

Dietrich Burde
  • 130,978
2

I think the $\mathit{commonly\ done}$ method works well and gives the single solution $(m,n,p)=(5,2,7)$. Maybe I am missing something, but I'm still giving the argument I have come up with. Kindly point out if there is any mistake.

First, note that $$p(p-1)=2(m-n)(m+n)\Rightarrow\ (m-n)|(p-1)/2$$ since $p$ is an odd prime here, $m,n$ positive. Then it implies that $p|(m+n)$. Now if $p\ne m+n$, then $(m+n)|(p-1)/2$ which consequently makes $p|(m-n)$ which is a contradiction. So \begin{equation} \begin{split} m+n=& p \\ m-n=&(p-1)/2\\ \end{split} \end{equation} This gives $$n=\frac{p+1}{4}$$ and this from the first equation given in the question leads to $p=7$. Then it follows from the above equations that $m=5,n=2$.

Edit: The solution I have given here is only one solution, and hence what I am claiming to be as single solution is wrong. There can be other solutions as pointed out by user70520. I will try to find those solutions too.

  • Why does that impplies that $p|(m+n)$? I mean, what if $p$ partially divides $m+n$ and $m-n$, while $p-1$ divides $2$ and the other part of $m+n$ and m-n? I can't get your argument, and I would appreciate very much an explanation. – chubakueno Jul 19 '13 at 02:55
  • @chubakueno What do you mean by $p\ partially$ divides? – Samrat Mukhopadhyay Jul 19 '13 at 09:11
  • Anyway, my argument is that since $p$ is a prime, it has to divide either $m+n$ or $m-n$. If say it divides $m^2-n^2$ but none of $m+n$ or $m-n$, then $p\nmid (m+n)$ but gcd$(m+n,p)\ne 1$ which is a contradiction to the fact that $p$ is a prime. – Samrat Mukhopadhyay Jul 19 '13 at 09:17
  • Oh, now i get it. And the fact that $p>p-1$ excludes $m-n$ from the possibilities. Thanks. – chubakueno Jul 19 '13 at 14:31
  • Exactly @chubakueno. – Samrat Mukhopadhyay Jul 19 '13 at 14:37
  • Why is it true that $p\neq m+n\implies(m+n)|\frac12(p-1)$? – user70520 Aug 29 '13 at 06:11
  • @user70520, thiws is true because, $\displaystyle p\ne m+n\Rightarrow m-n=p\frac{p-1}{2(m+n)}$ since both sides have to be integers this implies $\displaystyle m+n|\frac{p-1}{2}$ – Samrat Mukhopadhyay Aug 29 '13 at 07:45
  • From $m-n=\frac{p(p-1)}{2(m+n)}$ we can only conclude that $\frac{m+n}{p}|\frac{p-1}2$, no? How does it follow that $m+n|\frac{p-1}2$? Thanks. – user70520 Sep 01 '13 at 05:51
  • Correct, @user70520. I think that is what I was missing in my argument. So, it gives one of many possible solutions. I will try to edit the answer to get the full picture. Thanks for pointing out. – Samrat Mukhopadhyay Sep 01 '13 at 08:54
1

Just some comments which format better in an answer than in a comment. They may help give some insight into the nature of a solution.

Using the convergents to $\sqrt 2,$ it is quick to check that there are no other small solutions ($p\lt 10^{14}$).

If we ignore the prime condition for a moment we have $p=2n^2-1$ so that $$(2n^2-1)^2+1=2m^2,$$

which reduces to $$4n^4-4n^2=2m^2-2$$ or$$2n^2(n+1)(n-1)=(m+1)(m-1).$$

The left hand side is divisible by $8$. Noting that the highest common factor of $m+1$ and $m-1$ must divide their difference $2$, either $m+1$ or $m-1$ must be divisible by $4$. If $n$ is odd, this is replaced by $8$.

The left hand side is also divisible by 3, so either $m+1$ or $m-1$ is divsible by $6$ (both have to be even).

This form of the equation suggests there may be other constraints which are demanding to meet.

Note also that $m$ must be odd, so the right-hand side is eight times a triangle number, while the left-hand side is $8$ times the product of two successive triangle numbers - namely, with $m=2r+1$ we can cancel a factor $8$ to obtain $$\frac{n(n+1)}2\cdot\frac {n(n-1)}2=\frac{r(r+1)}2$$

J. W. Tanner
  • 60,406
Mark Bennet
  • 100,194