# On the Pell-like $Ax^2-By^2 = 1$

This is connected to the post, Mere coincidence? (prime factors). I was looking at NeuroFuzzy's dataset and noticed the line,

{{{1, {4, 2}}, {1, 4, 2, 4, 2}, 23762}}

It seems this could be generalized. Is it true that given the equation,

$$(n+1)x^2-ny^2 = 1\tag{1}$$

then its solutions are given by,

$$\frac{y_1}{x_1} = 1+\cfrac{1}{2n+\cfrac{1}{2}} = \frac{4n+3}{4n+1}\tag{2}$$

$$\frac{y_2}{x_2} = 1+\cfrac{1}{2n+\cfrac{1}{2+\cfrac{1}{2n+\cfrac{1}{2}}}} = \frac{16n^2+20n+5}{16n^2+12n+1} \tag{3}$$

and so for all $x_i, y_i$? I assume it is connected to the fact that,

$$\sqrt{\frac{n+1}{n}} = 1+\cfrac{1}{2n+\cfrac{1}{2+\cfrac{1}{2n+\cfrac{1}{2+\ddots}}}}\tag{4}$$

and truncating $(4)$ at the right periodic points, correct?

-
Essentially yes. Look up Pell's Equation. – Calvin Lin Aug 18 '13 at 22:06

Here $$\left( \begin{array}{c} x \\ y \end{array} \right)$$ will be a solution of $$(n+1) x^2 - n y^2 = 1.$$

We have an "automorph" or generator of the automorphism group or isometry group or orthogonal group of the indefinite binary quadratic form depicted; the form is $(n+1) x^2 - n y^2.$ $$A = \left( \begin{array}{cc} 2n+1 & 2 n \\ 2n+2 & 2n+1 \end{array} \right) ,$$ and

$$\left( \begin{array}{cc} 2n+1 & 2 n \\ 2n+2 & 2n+1 \end{array} \right) \left( \begin{array}{c} 1 \\ 1 \end{array} \right) = \left( \begin{array}{c} 4n+1 \\ 4n+3 \end{array} \right),$$

$$\left( \begin{array}{cc} 2n+1 & 2 n \\ 2n+2 & 2n+1 \end{array} \right) \left( \begin{array}{c} 4n+1 \\ 4n+3 \end{array} \right) = \left( \begin{array}{c} 16n^2 +12n+1 \\ 16 n^2 + 20 n + 5 \end{array} \right),$$

$$\left( \begin{array}{cc} 2n+1 & 2 n \\ 2n+2 & 2n+1 \end{array} \right) \left( \begin{array}{c} 16n^2 +12n+1 \\ 16 n^2 + 20 n + 5 \end{array} \right) = \left( \begin{array}{c} 64 n^3 + 80 n^2 + 24 n + 1 \\ 64 n^3 + 112 n^2 + 56 n + 7 \end{array} \right),$$

$$\left( \begin{array}{cc} 2n+1 & 2 n \\ 2n+2 & 2n+1 \end{array} \right) \left( \begin{array}{c} 64 n^3 + 80 n^2 + 24 n + 1 \\ 64 n^3 + 112 n^2 + 56 n + 7 \end{array} \right) = \left( \begin{array}{c} 256 n^4 + 448 n^3 + 240 n^2 + 40 n + 1 \\ 256 n^4 + 576 n^3 + 432 n^2 + 120 n + 9 \end{array} \right),$$

and so on forever. Except for $\pm$ sign these are all.

-
Thanks. I was hoping for an answer connecting it to the continued fraction $(4)$, but this is a good answer too. – Tito Piezas III Aug 19 '13 at 3:16
@TitoPiezasIII, the two are intimately connected; this really is continued fractions. See Buchmann and Vollmer (2007), Binary Quadratic Forms, especially pages 132-134; or Duncan A. Buell (1989), Binary Quadratic Forms, all of Chapter 3. – Will Jagy Aug 19 '13 at 3:45
The quick version is this: two consecutive convergents for a C.F. make a two by two matrix. The second one, followed by the next in line, is another 2 by 2 matrix, found from the first by multiplying by a certain matrix of determinant $-1.$ – Will Jagy Aug 19 '13 at 4:13
ok, thanks for the explanation. – Tito Piezas III Aug 19 '13 at 23:00