Solving a quadratic Diophantine equation

946 Views Asked by At

I want to solve the following quadratic Diophantine equation:

$$\frac{x(x-1)}{y(y-1)}=\frac{p}{q} \hspace{5 mm}, \hspace{5 mm}p\le q$$ For $p=1$ and $q=2$, it is easy to solve.

Let $y=x+z$. Then after some simplification we get

$x^2-(2z+1)x-(z^2-z)=0$

For integral solution, the discriminant of this equation must be a whole square. Hence

$8z^2+1=k^2$

Now it is a standard Pell's equation which can easily be solved. But for arbitrary $p$ and $q$, using similar approach I get

$(2pz+q-p)^2+4p(q-p)(z^2-z)=k^2$

I am stuck here. Can someone help me?

2

There are 2 best solutions below

8
On BEST ANSWER

Here's a broad solution in integers. Given,

$$\frac{x(x-1)}{y(y-1)}=\frac{p}{q}\tag1$$

All you do is directly solve $(1)$ as a quadratic in $x$ and make its discriminant a square. After some manipulation, I find,

$$x = pv(u+qv)$$

$$y = qv(u+pv)$$

and $u,v$ solve,

$$u^2-pqv^2 = \color{red}-1\tag2$$

Or,

$$x = pv(u+qv)+1$$

$$y = qv(u+pv)+1$$

and $u,v$ solve,

$$u^2-pqv^2 = 1\tag3$$

2
On

I stopped at,

$$(2pz+q-p)^2+4p(q-p)(z^2-z)=k^2\tag1$$

After further simplification,

$$4pqz^2+(q-p)^2=k^2\tag2$$

then,

$$\big(\frac{k}{q-p}\big)^2-\frac{4pq}{(q-p)^2}z^2=1\tag3$$

which is the standard Pell's equation. Now it can easily be solved.