Karim Belabas on Thu, 20 Nov 2008 04:11:28 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Pell's equations and beyond |
* Max Alekseyev [2008-11-20 00:29]: > I dream about having the functionality of Dario Alpern's quadratic > bivariate Diophantine equation solver: > http://www.alpertron.com.ar/QUAD.HTM > in PARI/GP. Is anything like that already present there? > At the moment, I'm not even sure if there is a simple way to solve > Pell's equations in PARI/GP. > > Could you please clarify what is the best way (and if there exists one > without much programming) to solve the following equations in PARI/GP: > > 1) Pell's equation x^2 - D y^2 = 1, where D is integer ? This is more or less given by quadunit(D) or (much better when D is large), K = bnfinit(x^2 - D); K.fu Both assume that D is not a square. > 2) Generalized Pell's equation x^2 - D y^2 = c, where D and c are integer ? K = bnfinit(x^2 - D); bnfisintnorm(K, c) Assumes D not a square. Otherwise, it's "simpler" but a bit tedious to program (special case c = 0, otherwise for each divisor of c, you get a new 2 x 2 linear system). > 3) Quadratic bivariate Diophantine equation in the general form: ax^2 > + bxy + cy^2 + dx + ey + f = 0, where a,b,c,d,e,f are integer > coefficients ? You can reduce it to the above cases by a translation, but it's again tedious: have to treat separately a number of degenerate cases... Cheers, K.B. -- Karim Belabas, IMB (UMR 5251) Tel: (+33) (0)5 40 00 26 17 Universite Bordeaux 1 Fax: (+33) (0)5 40 00 69 50 351, cours de la Liberation http://www.math.u-bordeaux.fr/~belabas/ F-33405 Talence (France) http://pari.math.u-bordeaux.fr/ [PARI/GP] `