I have the fundamental solution of the following Diophantine equation: $$\frac{x(x-1)}{y(y-1)}=\frac{m}{n} \hspace{5 mm}, \hspace{5 mm} m \le n$$ $$nx^2-my^2-nx+my=0$$ Is it possible to derive a recurrence relation using which we can get the complete set of solution?
For example, if $m=1$ and $n=2$, then initial solution is $(x,y)=(3,4)$ and we can get the next solution by the linear transformation $(x,y) \rightarrow (3x+2y-2,4x+3y-3)$.
Can it be generalised for all $(m,n)$?
My approach:
Let the transform be $(x,y) \rightarrow (ax+by+c,px+qy+r)$, then substituting these in original equation and after some simplification,
$$(na^2-mp^2)x^2-(mq^2-nb^2)y^2-(an-pm+2prm-2acn)x+(2bcn-bn-2qrm+qm)y+(2abn-2pqm)xy+(nc^2-nc-mr^2-mr)=0$$ Comparing with original equation we have to solve following set of equations: $$na^2-mp^2=n$$ $$mq^2-nb^2=m$$ $$an-pm+2prm-2acn=n$$ $$2bcn-bn-2qrm+qm=m$$ $$2abn-2pqm=0$$ $$nc^2-nc-mr^2-mr=0$$ Is there any method using I can solve these equations efficiently to get $(a,b,c)$ and $(p,q,r)$?
$UPDATE:$
Using the method http://www.alpertron.com.ar/METHODS.HTM, I have to solve $r^2-mns^2=1$ and find the fundamental solutions.
Let $X_n$ and $Y_n$ be the initial solution, then next solutions will be:
$$X_{n+1}=(r^2+mns^2)X_n+2mrsY_n-(mns^2+mrs)$$ $$Y_{n+1}=2nrsX_n+(r^2+mns^2)Y_n-(mns^2+nrs)$$
For $m=1$ and $n=2$, $r=3$ and $s=2$, $$X_{n+1}=17X_n+12Y_n-14$$ $$Y_{n+1}=24X_n+17Y_n-20$$
Which gives the solution $(x,y):(3,4) \rightarrow (85,120)$ instead of $(x,y):(3,4) \rightarrow (15,21)$. This recurrence does not give complete set of solutions.