Bill Allombert on Wed, 22 Oct 2008 22:25:05 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Lists of class numbers of imaginary quadratic fields - help pls? |
On Wed, Oct 22, 2008 at 01:36:21PM +0100, James Wanless wrote: > Hi, > 1) Thanks to the devs for PARI/GP, I have already found it very > useful and fun, and if it can solve my problem here I'll be very > grateful! > 2) I'm trying to use/modify the following program (from OEIS) to > generate above lists (up to h=50 or even above, hopefully): > { bnd = 10000; S = vector(10, X, []); for (i = 1, bnd, if > (issquarefree(i), n = qfbclassno(if(i%4==3, -i, -4*i)); if (n<11, S > [n] = concat(S[n], i), ), )); } > 3) I'm using gp V2.3 on a PPC iMac G5 (in case that's relevant) > 4) When I compare lists for the first few h, there is a good, but not > perfect match with the tables at http://mathworld.wolfram.com/ > ClassNumber.html > Why is that, please? And which should I trust? [or are they both > right and there is some mapping involving genera I need to consider?] It seems the problem is that you should store the discriminant and not i, { bnd = 10000; S = vector(10, X, []); for (i = 1, bnd, if (issquarefree(i), d = if(i%4==3, -i, -4*i); n = qfbclassno(d); if (n<11, S [n] = concat(S[n], -d), ), )); } Second qfbclassno is known to be unreliable. Use n = quadclassunit(d).no instead. However your program seems to return correct results even while using qfbclassno. Cheers, Bill.