hermann on Wed, 16 Sep 2026 21:07:26 +0200


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

Re: Is my understanding on how my 0-based vector access works correct?


On 2026-09-16 19:36, hermann@stamm-wilbrandt.de wrote:
On 2026-09-16 12:07, Bill Allombert wrote:
With 2.18.1, you can compute it exactly:
? contfrac(quadgen(4*23))
%8 = [[4],[1,3,1,8]]
which means it is 4 followed by 1,3,1,8 repeating infinitely.

That is great, not for code for oeis.org or a repo because
it will not work for backlevel versions of gp for others.

But really impressive for my work, succeeds where previous approach just fails!

I just added new "fundsol_2_18()" to make use of the pari-2.18 feature:
https://github.com/Hermann-SW/uni-heidelberg/blob/main/scripts/pell.gp#L13-L18

Works, and really big numbers were needed to be able to measure a runtime difference to "quadunit()" based "fundpari()" solution, which is preferable for Pell equation.

hermann@8840hs:~/pari-2.18.1.alpha$ ./gp -q ../uni-heidelberg/scripts/pell.gp
? d=nextprime(10^11)
100000000003
? [x,y]=fundsol_2_18(d);
? ##
  ***   last result computed in 420 ms.
? x^2-d*y^2==1
1
? [#digits(x),#digits(y)]
[36719, 36713]
? [x,y]=fundpari(d);
? ##
  ***   last result computed in 8 ms.
? x^2-d*y^2==1
1
?

Regards,

Hermann.