[seqfan] Re: A063747 sign of power series expansion of the Gamma function

Christian Sievers seqfan at duvers.de
Sat May 20 00:04:36 CEST 2023


Hi,

I just learned about FLINT and Arb, which seem perfect for this kind of
problem. Arb offers arbitrary-precision ball arithmetic and used to be a
separate library, but they will now be joined.
Here I'm using the python binding which already combines them.

It allows to compute 1000 values in seconds like this:

----------------------------------------
from flint import arb_series, good, ctx
ctx.cap = 1000
res = good(lambda: [ v.sgn() for v in 
                     arb_series([1,-1]).rgamma().coeffs()],
           maxprec=100000)
res = [ v.unique_fmpz() for v in res ]
----------------------------------------

"good" repeats the computation, until the values are good enough
(default precision), but since they are signs, they are either exact or
very imprecise. "maxprec" just limits the precision it uses before it
gives up, it will not return unsure results.

The first 100 results agree with those given by Hugo Pfoertner:

> With my(x='x+O('x^150)); apply(sign, Vec(1/(gamma(1-x)))) and \p1000 and
> \p10000 I get identical results for the first 100 terms.
> [1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, -1, -1,
> -1, -1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1, 1,
> -1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1,
> 1, 1, 1, 1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1,
> 1, -1, -1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1] wrong?

(I hope what I'm writing is correct, I really don't know much about
all this stuff. But most has been checked: for example, a smaller
"maxprec" value gives an error message, not a wrong result.)


All the best,
Christian


More information about the SeqFan mailing list