# A Pell equation inside a Pell equation

While working on another problem (see https://mathoverflow.net/questions/143599/solving-the-quartic-equation-r4-4r3s-6r2s2-4rs3-s4-1), I found the following equation to be solved: $$\bigl((r+s)^2-2s^2\bigr)^2 - 2(2rs)^2 = 1. \tag{*}$$

Conjecture: There are no solutions with $r > 3$; put another way the solution $(r,s)=(3,2)$ is the only solution with $r>s>0$.

Clearly, $(*)$ is the Pell equation $u^2-2v^2=1$, the fundamental solution of which is [perhaps coincidentally?] $(u,v)=(3,2)$. However, in this case, every other solution $u$ is of the same form, i.e., $u=(r+s)^2-2s^2$. This leads me to believe there is some sort of elementary descent argument that can prove the conjecture. Can anyone point me in the right direction?

Thanks, Kieren.

EDITED to incorporate Will Jagy's observation about "every [other] solution".

EDIT: In addition to (*), the following similar Pell equation is simultaneously true: $$\bigl((r-s)^2-2s^2\bigr)^2 - 2(r^2-s^2)^2 = -1.$$

EDIT (2014/06/05): Is there a way to prove that these two simultaneous Pell equations force $(r,s)$ to be a solution to $X^2-2Y^2=\pm1$?

• It is only every other solution of $u^2 - 2 v^2 = 1$ that has any expression $u = a^2 - 2 b^2.$ Compare oeis.org/A056771 to oeis.org/A001541 Commented Apr 30, 2014 at 4:07
• The fundamental solution of $u^2-2v^2=-1$ is evidently $(u,v)=(1,1)$. Commented May 4, 2014 at 22:06

[Edited mostly to add the uniqueness of the $(119,120,169)$ triangle and the elliptic-curve connection]

The conjecture is correct, and equivalent to a famous theorem of Ljunggren (1942, see references below). No really simple proof is known, and it might be that such a proof is not possible; the existence of several solutions such as $(3,2)$ suggests it's hard to get a proof with elementary techniques $-$ for instance an attempt to use just congruences is bound to fail because any congruence condition must allow the two orbits $\{ (0,\pm1), (1, \pm0) \}$ and $\{(\pm3,\pm2), (\pm2,\mp3)$ of small solutions.

The left-hand side $\left( (r+s)^2 - 2s^2 \right)^2 - 2(2rs)^2$ is a homogeneous quartic polynomial $$Q(r,s) = r^4 + 4r^3s - 6r^2s^2 - 4rs^3 + s^4.$$ Hence we are dealing with the Thue equation $Q(r,s) = 1$. Thue proved that such an equation has only finitely many solutions. His proof is ineffective, i.e. does not yield a method for provably finding all solutions; but later results do make this possible. One technique is implemented in several computer algebra packages, including gp in which the command

thue(thueinit(r^4+4*r^3-6*r^2-4*r+1),1)


yields the expected list

[[-2, 3], [2, -3], [0, 1], [0, -1], [3, 2], [-3, -2], [1, 0], [-1, 0]]


and reports only 14 milliseconds' computing time on my laptop. But this relies on some quite difficult theorems to bound the search.

The quartic $Q$ is quite nice: it has fourfold symmetry generated by $(r,s) \mapsto (s,-r)$, and the roots of $Q(r,1)=0$ generate the cyclic quartic field ${\bf Q}(\cos \pi/8) = \frac12 \sqrt{2+\sqrt 2}$. But ironically this symmetry makes it hard to use a more elementary technique, Skolem's $p$-adic method, which often succeeds in showing that a moderately large list $L$ of solutions is complete by showing that any other solution must be congruent to one of the solutions in $L$ modulo an arbitrarily large power of $p$. Ljunggren thus resorted to applying the method not over ${\bf Q}(\cos \pi/8)$ but over some quadratic extension, which made his proof even harder to carry out and to follow (though still not as hard as the bounds exploited by the thue function).

The equation in the title of Ljunggren's paper is not $Q(r,s)=1$ but $X^2 + 1 = 2Y^4$, which has large integer solutions $(X,Y) = (\pm 239, \pm 13)$ [NB $(1+\sqrt2)^7 = 239 + 13^2 \sqrt 2$] in addition to the clear $(X,Y) = (\pm 1, \pm 1)$. Ljungreen showed that there are no other solutions. Thanks to the identity $$Q(r,s)^2 + Q(r,-s)^2 = 2(r^2+s^2)^4$$ it follows that any solution of $Q(r,s) = 1$ has $r^2+s^2 = 1$ or $13$, which soon yields the desired result.

Conversely any integer solution of $2X^2 + 1 = Y^4$ yields an integer solution of $Q(r,s) = 1$, as Steiner and Tzanakis show in Section II of their paper; they use arithmetic in the Gaussian ring ${\bf Z}[i]$, but one can instead write the Ljunggren's equation as a primitive Pythagorean triple $((X-1)/2, (X+1)/2, Y^2)$ and apply the parametrization $(m^2-n^2,2mn,m^2+n^2)$ of Pythagorean triples twice, first to obtain $$m^2-n^2-2mn = \pm 1, \quad m^2+n^2 = Y^2$$ and then to the resulting triple $(m,n,Y)$. Section III then gives a proof of the solution of $Q(r,s) = 1$ which the authors claim is simpler than Ljunggren's, but it requires "a deep result of Mignotte and Waldschmidt on linear forms in logarithms" (presumably the same result that the gp program exploits), so the Steiner-Tzanakis proof ends up even more complicated than Ljunggren's.

Ljunggren, W.:, Zur Theorie der Gleichung $x^2 + 1 = Dy^4$, Avh. Norske, Vid. Akad. Oslo 1 #5 (1942)

Steiner, R., and Tzanakis, N.: Simplifying the Solution of Ljunggren's Equation $X^2 + 1 = 2Y^4$, Journal of Number Theory 37 (1991), 123-132

P.S. 1) The Ljunggren/Pythagorean-triple connection also gives the following equivalent formulation: There is a unique nearly-isosceles Pythagorean triangle, namely $(119, 120, 169)$, whose hypotenuse is a square. (I use "nearly isosceles" to mean $(a,b,c)$ with $a-b = \pm 1$.)

2) If $Q(r,s) = 1$ then $(r,s,1)$ is a integer solution of $Q(r,s) = u^2$. If we seek rational solutions, we get an elliptic curve $E$ isomorphic with $y^2 = x^3 - 2x$ [explicitly $u/s^2 = t^2+2t-1 - 2x$ where $t=r/s=(y-x)/(x-2)$]. By standard descent techniques one shows that $E$ has infinitely many points, each of which is either $kP$ or $kP+T$ where $P$ is the point $(x,y)=(-1,1)$ and $T$ is the 2-torsion point $(x,y)=(0,0)$. The symmetries of the problem let us assume without loss of generality that it's $kP$ with $k$ odd. At this point we can use $p$-adic techniques to show that $k = \pm 1$, which recovers the known solutions. For example, if we use $p=3$ then it seems that the numerator of $u/s^2$ is congruent to $1 \bmod 3^f$ iff $k \equiv \pm 1 \bmod 3^{f-1}$, whence $u=1$ happens only at the known $k = \pm 1$. A proof along these lines, though still far from elementary, might satisfy Mordell's desire for a proof simpler than Ljunggren's, as well as Kieren MacMillan's hope for a proof that uses descent (though descent is not the only ingredient).

The fundamental solution to Pell's equation $x^2 - 2 y^2 = 1$ is $x_0 = 3$, $y_0 = 2$. All other solutions can be expressed by: $$x_n - y_n \sqrt{2} = (x_0 - y_0 \sqrt{2})^n$$ this is: \begin{align} x_{n + 1} - y_{n + 1} \sqrt{2} &= (x_n - y_n \sqrt{2}) \cdot (3 - 2 \sqrt{2}) \\ &= (3 x_n + 4 y_n) - (2 x_n + 3 y_n) \sqrt{2} \end{align} Mangling, spindling, and otherwise manhandling the above gives the recurrences: \begin{align} x_{n + 1} &= 3 x_n + 4 y_n \\ y_{n + 1} &= 2 x_n + 3 y_n \end{align} Now you have: \begin{align} x_n &= (r + s)^2 - 2 s^2 \\ y_n &= 2 r s \end{align} so that: $$r^2 - s^2 = x_n - y_n$$ One solution to this is given by $r - s = 1$ so that $r^2 - s^2 = 2 s + 1$, as long as $x_n - y_n$ is odd you get a solution: $$r = \frac{x_n - y_n + 1}{2}, s = \frac{x_n - y_n - 1}{2}$$ It turns out that both $x_n$ and $y_n$ satisfy the recurrence: $$u_{n + 2} = 6 u_{n + 1} - u_n$$ so that $x_n - y_n$ also satisfies this recurrence. Initial values are $x_0 - y_0 = 1$, $x_1 - y_1 = 5$, and by induction through the recurrence $x_n - y_n$ is always odd.

• What is the conclusion here? Surely you're not saying that each $(x_n,y_n)$ gives a pair $(r,s)$ that solves the OP's equation: $(x_2,y_2)=(99,70)$, but $(r,s)=(15,14)$ is not a solution to $((r+s)^2-2s^2)^2-2(2rs)^2=1$. Commented May 6, 2014 at 19:49
• @BarryCipra, right. Forgot that they also have to satisfy the equations separately. Brain malfunction :-( Commented May 6, 2014 at 20:00
• It's nice to know I'm not the only one with a malfunctioning brain ;) Commented May 6, 2014 at 20:03

For Pell's equation: $x^2-2y^2=1$ following decision $(x_1;y_1)$ You can find previous knowledge $(x;y)$ formula:

$x_1=3x\pm4y$

$y_1=2x\pm3y$

We get a system. In this case we can set any shape these decisions - as we want. Well, it will be necessary to solve this system.Although you can not solve. You can see that at each step on the right is a polynomial of n-th degree, and left the second degree. In integers no solutions. Rather if there is one.