# Showing that $m^2-n^2+1$ is a square

Prove that if $m,n$ are odd integers such that $m^2-n^2+1$ divides $n^2-1$ then $m^2-n^2+1$ is a square number.

I know that a solution can be obtained from Vieta jumping, but it seems very different to any Vieta jumping problem I've seen. To start, I chose $m=2a+1$ and and $n=2b+1$ which yields: $$4ka^2+4ka-4kb^2-4kb+k = b^2+b$$ Then suppose that $B$ is a solution, and $B_0$ is another solution. Then using Vieta jumping we get (with a bit of algebra) that $B+B_0 = -1$ and $B_0 = \frac {-k(2a+1)^2}{B(4k+1)}$.

But I'm not sure these final equalities are particularly helpful; I can't find any way to yield more solutions from them. How can I solve the problem? A solution without Vieta jumping is probably also possible

• I don't have a solution to this problem yet. But I can see where you went wrong from the very beginning: instead of setting up that $m^2−n^2+1$ divides $n^2−1$, you set up an equation saying that "$m^2−n^2+1$ is a multiple of $n^2−1$", which is a totally different thing. – zipirovich Mar 16 '17 at 0:43
• @zipirovich Sorry, that's actually a mistake which I had fixed in my workings, but forgot to fix it fully when typing it up. The final expression for $B_0$ is correct. – Cataline Mar 16 '17 at 0:57
• Shouldn't it be $4ka^2+4ka-4kb^2-4kb+k = 4b^2+4b$? EDIT: Then we know that $k$ is multiple of $4$ and divide each side by $4$. – didgogns Mar 18 '17 at 13:35
• @didgogns that's a possible way forward, but you can actually remove the $4$ factor from $b^2+b$ since the left-hand side is odd. I'll see if that helps but I don't think it will be vastly different to what I've already written. – Cataline Mar 18 '17 at 14:19
• Cataline, got it when $m^2 - n^2 + 1 > 0.$ There really are negative solutions when allowing $m,n$ even, so this is not all. – Will Jagy Mar 19 '17 at 3:16

Under the assumption that the integer ratio is positive:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

LEMMA

Given integers $$M \geq m > 0,$$ along with positive integers $$x,y$$ with $$x^2 - Mxy + y^2 = m.$$ Then $$m$$ is a square.

PROOF.

First note that we cannot have integers $$xy < 0$$ with $$x^2 - Mxy + y^2 = m,$$ since then $$x^2 - Mxy + y^2 \geq 1 + M + 1 = M + 2 > m.$$ If we have a solution with $$x > 0$$ and $$xy \leq 0,$$ it follows that $$y=0.$$

This is the Vieta jumping part, with some extra care about inequalities.

Case I: We begin with integers $$y > x > 0$$ and the stronger $$y > Mx.$$ Then we get a new solution by jumping $$(x,y) \mapsto (Mx - y,x).$$ However, the assumption $$y > Mx$$ means $$Mx-y < 0,$$ we cannot have a solution with one variable positive and the other negative. This case cannot occur.

Case II. $$y > x > 0$$ and $$y = Mx.$$ But then $$x^2 - Mxy + y^2 = x^2 - M^2 x^2 + M^2 x^2 = x^2.$$ Therefore $$x^2 = m$$ which is a square.

Case III. $$y > x$$ and $$y < Mx.$$ We have $$x^2 - Mxy + y^2 > 0,$$ $$x^2 > Mxy - y^2 = y(Mx - y) > x(Mx-y),$$ $$x > Mx - y > 0.$$ That is, the jump $$(x,y) \mapsto (Mx - y,x)$$ takes us from one ordered solution to another ordered solution while strictly decreasing $$x+y.$$ Within a finite number of such jumps we violate the conditions we were preserving; we reach a solution $$(x,y)$$ with $$y \geq Mx,$$ that is $$x > 0$$ but $$Mx-y \leq 0.$$ Since $$(Mx - y,x)$$ is another solution we know that $$Mx-y = 0.$$ Therefore $$x^2 = m$$ and $$m$$ is a square.

Graph for $$x^2 - 5xy + y^2 = 3$$

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Suppose we have odd integers $$m,n > 0$$ such that $$\frac{n^2 - 1}{m^2 - n^2 + 1} = k > 0$$ is an integer. Then $$k+1 = \frac{m^2 }{m^2 - n^2 + 1}.$$ Name $$w = 1 + k,$$ so $$w = \frac{m^2 }{m^2 - n^2 + 1}.$$ We are sticking with positive $$w$$ so we may take $$m \geq n >0.$$ When we write $$m-n = 2x,$$ $$m+n = 2y,$$ we are introducing positive variables. Then $$m=x+y,$$ $$n = y - x,$$ and $$w = \frac{x^2 + 2xy + y^2}{4xy+1},$$ $$x^2 + 2xy+ y^2 = 4wxy + w,$$ $$x^2 - (4w-2)xy + y^2 = w.$$ From the LEMMA, we find that $$w$$ is a square. From $$w = \frac{m^2 }{m^2 - n^2 + 1}$$ we see that $$m^2 - n^2 + 1$$ is also a square.

I like it.

   1225   m-n    6      105       99     1225 = 5^2 * 7^2
9801   m-n   10      495      485     9801 = 3^4 * 11^2
38025   m-n   14     1365     1351     38025 = 3^2 * 5^2 * 13^2
104329   m-n   18     2907     2889     104329 = 17^2 * 19^2
1413721   m-n  204     3567     3363     1413721 = 29^2 * 41^2
233289   m-n   22     5313     5291     233289 = 3^2 * 7^2 * 23^2
455625   m-n   26     8775     8749     455625 = 3^6 * 5^4
808201   m-n   30    13485    13455     808201 = 29^2 * 31^2
1334025   m-n   34    19635    19601     1334025 = 3^2 * 5^2 * 7^2 * 11^2
2082249   m-n   38    27417    27379     2082249 = 3^2 * 13^2 * 37^2
3108169   m-n   42    37023    36981     3108169 = 41^2 * 43^2


The main sequence has $$m = 32 w^3 + 48 w^2 + 22 w + 3,$$ $$n = 32 w^3 + 48 w^2 + 18 w + 1,$$ $$m^2 - n^2 + 1 = \left( (4w+1)(4w+3) \right)^2$$ $$n^2 - 1 = \; 4 \, w \; (w+1) \; \left( (4w+1)(4w+3) \right)^2$$ This does NOT include

1413721   m-n  204     3567     3363     1413721 = 29^2 * 41^2

• Interesting, but sadly still not a proof. Don't suppose you have any ideas for proving this question? – Cataline Mar 18 '17 at 21:51
• @Cataline sure. It may take me some time. The usual Viete jumping is about the binary quadratic form $x^2 - k x y + y^2.$ This one seems to be about $(k+1)x^2 - k y^2.$ The automorphism group is easy enough to calculate. Where did you get the problem? – Will Jagy Mar 18 '17 at 22:49
• I got it from the IrMO (Irish Maths Olympiad) 2005 paper 2. – Cataline Mar 18 '17 at 23:09
• @Cataline thank you. Context helps. My main field is quadratic forms, so I will come up with something given time. That does not mean I will duplicate the methods you would be expected to use. Oh, if $m,n$ are allowed even, one or both, there are plentiful solutions where the quantity asked about is not a square, including many negative values. Did they specify that $m > n?$ – Will Jagy Mar 18 '17 at 23:15
• @Cataline found it irmo.ie/irmo.pdf they do not specify. So, part of the problem is showing that $m,n$ odd forces $m^2 - n^2 + 1 > 0.$ pdf number 41, page numbering 37 I think. – Will Jagy Mar 18 '17 at 23:18

Proof: First, consider $n^2 - 1 = (d^2 - 1)(m^2 - n^2 + 1)$, where $d \mid m$, $d$ is a positive divisor of $m$. It is easy to see that in this case $m^2 - n^2 + 1 = \left( \frac{m}d \right)^2$. Then it suffices to show that these are the only possibilities of writing $$n^2 - 1 = k(m^2 - n^2 + 1), \hspace{3em} \text{ (*)}$$ where $k$ must be of the form $d^2 - 1$.

Note by (*) we have that $k$ is bounded by $m^2 - 1$. (Since $k \leqslant n^2 -1 \leqslant m^2 - 1$.) Also by (*) we notice that $k m^2 = (k+1)(n^2 - 1)$. $k$ must be even otherwise $m$ cannot be odd. But $k+1 \nmid k$, it implies we must have $k + 1 \mid m^2$, i.e., $k$ must be of the form $d^2 - 1$. Q.E.D.

Edit:

Needs to fix the gap for the struck through implication.

• I don't see it. The fact that a number, your $k+1,$ divides a square $m^2,$ does not make $k+1$ a square. For example, $5 | 25.$ – Will Jagy Mar 19 '17 at 20:35
• @WillJagy Oops. Thanks for pointing that out! Let me see if I can fix that with both $k+1 \mid m^2$ and $k \mid n^2 - 1$. – swoopin_swallow Mar 19 '17 at 21:22

I have produced the lemma that rules out negative ratios. It is to be applied after the business of wrting the sum and difference of the pair of odd integers as double new variables.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

LEMMA

Given integers $$m > 0, \; \; M > m+2,$$ there are no integers $x,y$ with $$x^2 - Mxy + y^2 = -m.$$

PROOF

Calculus: $m+2 > \sqrt{4m+4},$ since $(m+2)^2 = m^2 + 4m + 4,$ while $\left( \sqrt{4m+4} \right)^2 = 4m + 4.$ Therefore also $$M > \sqrt{4m+4}$$

We cannot have $xy < 0,$ as then $x^2 - M xy + y^2 \geq 2 + M > 0.$ It is also impossible to have $x=0$ or $y=0.$ From now on we take integers $x,y > 0.$

With $x^2 - Mxy + y^2 < 0,$ we get $0 < x^2 < Mxy - y^2 = y(Mx - y),$ so that $Mx - y > 0$ and $y < Mx.$ We also get $x < My.$

The point on the hyperbola $x^2 - Mxy + y^2 = -m$ has both coordinates $x=y=t$ with $(2-M) t^2 = -m,$ $(M-2)t^2 = m,$ and $$t^2 = \frac{m}{M-2}.$$ We demanded $M > m+2$ so $M-2 > m,$ therefore $t < 1.$ More important than first appears, that this point is inside the unit square.

We now begin to use the viewpoint of Hurwitz (1907). All elementary, but probably not familiar. We are going to find integer solutions that minimize $x+y.$ If $2 y > M x,$ then $y > Mx-y.$ Therefore, when Vieta jumping, the new solution given by $$(x,y) \mapsto (Mx - y, x)$$ gives a smaller $x+y$ value. Or, if $2x > My,$ $$(x,y) \mapsto (y, My - x)$$ gives a smaller $x+y$ value. We already established that we are guaranteed $My-x, Mx-y > 0.$

Therefore, if there are any integer solutions, the minimum of $x+y$ occurs under the Hurwitz conditions for a fundamental solution (Grundlösung), namely $$2y \leq Mx \; \; \; \; \mbox{AND} \; \; \; \; 2 x \leq My.$$ We now just fiddle with calculus type stuff, that along the hyperbola arc bounded by the Hurwitz inequalities, either $x < 1$ or $y < 1,$ so that there cannot be any integer lattice points along the arc. We have already shown that the middle point of the arc lies at $(t,t)$ with $t < 1.$ We just need to confirm that the boundary points also have either small $x$ or small $y.$ Given $y = Mx/2,$ with $$x^2 - Mxy + y^2 = -m$$ becomes $$x^2 - \frac{M^2}{2} x^2 + \frac{M^2}{4} x^2 = -m,$$ $$x^2 \left( 1 - \frac{M^2}{4} \right) = -m$$ $$x^2 = \frac{-m}{1 - \frac{M^2}{4}} = \frac{m}{ \frac{M^2}{4} - 1} = \frac{4m}{M^2 - 4}.$$ We already confirmed that $M > \sqrt{4m+4},$ so $M^2 > 4m+4$ and $M^2 - 4 > 4m.$ As a result, $\frac{4m}{M^2 - 4} < 1.$ The intersection of the hyperbola with the Hurwitz boundary line $2y = Mx$ gives a point with $x < 1.$ Between this and the arc middle point, we always have $x < 1,$ so no integer points. Between the arc middle point and the other boundary point, we always have $y < 1.$ All together, there are no integer points in the bounded arc. There are no Hurwitz fundamental solutions. Therefore, there are no integer solutions at all.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=