Bill Allombert on Mon, 12 Dec 2022 22:40:37 +0100


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

Re: prodeeulerrat in residue classes?


On Mon, Dec 12, 2022 at 03:25:24PM -0500, Charles Greathouse wrote:
> Cohen's prodeulerrat works like magic -- very fast and accurate. Is it
> possible to extend this to rational products over primes in fixed residue
> classes? Alternatively, is there some good way to compute this sort of
> product in PARI/GP?
> 
> For example, the product over primes p = 1 (mod 3) of 1/(1 - 1/p^2), or the
> product over p = a (mod 24) of 1 - f(a)/p^2 where f(a) is in {0, 2, 4, 6}
> as in
> https://arxiv.org/abs/2211.07237

Yes this is often possible using the Flajolet-Vardi trick,
see http://algo.inria.fr/flajolet/Publications/landau.ps
I computed a number of those for Michel Waldschmidt, see
https://webusers.imj-prg.fr/~michel.waldschmidt/articles/pdf/CyclotomicForms.pdf
When it applies, this is usually faster than method based on Fourier transform.

For example

the product over primes p = 1 (mod 3) of 1/(1 - 1/p^2) can be computed with

gv(s)=(1-3^(-s))*zeta(s)/lfun(-3,s);
zeta(2)*(1-1/9)/prod(n=1,10,gv(2^n)^(1/2^n))

Unfortunately, lfun(-3,s) is slow for large s
a good replacement is Lv(s) below:

Lv3(s)=prodeuler(p=1,2^(bitprecision(1.)/s),1/(1-kronecker(-3,p)*p^-s))
Lv4(s)=2*imag(polylog(s,exp(2*I*Pi/3)))/sqrt(3)
Lv(s)=if(s>=10000,Lv3(s),Lv4(s))

Cheers,
Bill.