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

Yes this is often possible using the Flajolet-Vardi trick,
I computed a number of those for Michel Waldschmidt, see
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


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