Bill Allombert on Fri, 21 Nov 2008 15:47:15 +0100

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Pell's equations and beyond

On Wed, Nov 19, 2008 at 08:26:00PM -0800, Max Alekseyev wrote:
> Dear Karim,
> Thank you for the answers.
> One of important reasons I like Dario Alpern's java applet - it simply
> does "the job" for generic input by taking care of all possible
> branchings and degenerate cases. I would very welcome similar
> functionality for PARI/GP...
> As PARI/GP provides only basic functionality, I wonder if there is

You are slightly unfair with PARI: PARI includes efficient algorithms to solve
this task in (at worse) subexponential time, and so it can be used to deal with
much larger coefficients than the above applet, and that is the hard
part of the work.

For example, try to solve x^2-y^2=2^128+1, or x^2+3*y^2=2^607-1
(both being relatively easy).

> available any third-party wrapper that would take care of all
> degenerate cases in the course of solving general quadratic bivariate
> Diophantine equation?

Let be on the record that PARI has a function qfbsolve to solve the
equation a*X^2+b*X*Y+c*Y^2=p where b^2-4*ac!=0 and p is prime.
(Should be used when b^2-4*a*c<0, else bnfisintnorm is faster).

> Or is it possible to extend PARI/GP functionality this way?

One could write a GP script for that task.