3
$\begingroup$

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?

$\endgroup$
4
  • $\begingroup$ It is still a quadratic in $z$, and the earlier approach should work for any specific $p,q$. If you are looking for a general expression for the solutions in terms of $p,q$ I doubt you'll get it though. $\endgroup$
    – Macavity
    Aug 30, 2015 at 15:01
  • $\begingroup$ In earlier case I managed to get the standard Pell's equation of form $x^2-dy^2=1$. How can I approach for any $p$ and $q$. Yes, closed form is not possible in terms of $p$ and $q$, but there might be some other method. $\endgroup$
    – user125368
    Aug 30, 2015 at 15:09
  • $\begingroup$ You may want to take a look at math.stackexchange.com/questions/490617/… $\endgroup$
    – Macavity
    Aug 30, 2015 at 15:58
  • $\begingroup$ @guest123456: Actually, a closed-form is possible. $\endgroup$ Aug 31, 2015 at 4:45

2 Answers 2

4
$\begingroup$

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$$

$\endgroup$
8
  • $\begingroup$ It seems that you missed $+1$ at the end of both the expression of $x$ and $y$. $\endgroup$
    – user125368
    Aug 31, 2015 at 13:14
  • 1
    $\begingroup$ @guest123456: Oh, you're right. The first solution is for the negative Pell equation. I've edited, and also got rid of the unnecessary factor of 2. Thanks. :) $\endgroup$ Aug 31, 2015 at 13:36
  • 1
    $\begingroup$ Your method does not give the complete set of solutions. For example if $p=1$ and $q=2$, then your method gives $x=15$ and $y=21$, which is correct but not the smallest solution. Smallest solution is $x=3$ and $y=4$. $\endgroup$
    – user125368
    Aug 31, 2015 at 13:50
  • $\begingroup$ @guest123456: Yes, I know. That's why I carefully started with "Here's a broad..." Nowhere in your post did you ask for the complete solution. :) $\endgroup$ Aug 31, 2015 at 13:58
  • 1
    $\begingroup$ @guest123456: Using the negative Pell, it does give the smallest solution. Let $p,q=1,2$, and $u^2-2v^2 =-1$, so $u,v = 1,1$, and the formula yields $x,y = 3,4$. $\endgroup$ Aug 31, 2015 at 14:12
0
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ How did you get from $(2)$ to $(3)$? $\endgroup$ Aug 31, 2015 at 11:31
  • 1
    $\begingroup$ Thanks for pointing out the mistake. $\endgroup$
    – user125368
    Aug 31, 2015 at 12:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy