What are the PARI/GP alternatives to contfrac() ?

Max Alekseyev maxale at gmail.com
Fri Dec 28 20:40:20 CET 2007


On Dec 28, 2007 11:21 AM, Alexander Povolotsky <apovolot at gmail.com> wrote:

> I don't mind to be corrected but this time I just was quoting what the entry
> in the
> http://en.wikipedia.org/wiki/Continued_fraction wiki says.
> Perhaps you have not looked yourself at it directly
> (now I copied ant pasted it below for your viewing pleasure ).

Sure, I have.

> Max -  if you feel that discussed wiki entry incorrect - please do go ahead
> and correct it.

I have already corrected it.

> PS Could you please show your PARI/GP results in generating last two
> variants (as shown /pasted below) using contfrac() with additional argument
> ?

There seems to be no way to do so since the sequence of numerators
does not completely define a generalized (irregular) continued
fraction. PARI/GP computes numerators in a greedy manner and for the
sequence of odd squares, it produces:

? contfrac(Pi-3,vector(5,i,(2*i-3)^2))
%1 = [0, 7, 143, 25, 61]

Here
Pi = 3 + 1^2/(7 + 3^2/(143 + 5^2/(25 + 7^2/(61 + ...
is perfectly valid generalized continued fraction with the sequence of
odd squares as partial numerators, however, it is different from the
one mentioned in wikipedia.

Regards,
Max





More information about the SeqFan mailing list