Karim Belabas on Sun, 25 Aug 2013 11:29:09 +0200

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

Re: Two questions about products

* Charles Greathouse [2013-08-21 15:43]:
> A quick second question: I notice that prodeuler() works like prod(X=a,b,
> 1.) rather than prod(X=a,b). Is this intentional?

Yes, though seemingly a little inconsistent since prod/sum allow this
extra argument. The idea behind the design was that prodeuler() should
be a decent, albeit naive, way of estimating "full" Euler products, over
all primes. So it's implemented as a "transcendental" function, taking
a 'prec' argument, etc. Whereas sum/prod are basic iterators.

Nowadays, the function prodeulerrat() in


should be used instead, whenever f(p) = 1 + O(p^(-2)).

> Would it be possible to
> give it a third argument so that prodeuler(p=a, b, 1) could be used if an
> integer result was desired?

It's possible, but what's wrong with

  C = 1; forprime(p = a,b, C *= f(p))



P.S. Plans to clean up 


and make it more useful / accessible were discussed during the last Atelier.


and the sample script


But I had no time for it last semester :-(.

Anybody interested in helping out for that project ?

Karim Belabas, IMB (UMR 5251)  Tel: (+33) (0)5 40 00 26 17
Universite Bordeaux 1          Fax: (+33) (0)5 40 00 69 50
351, cours de la Liberation    http://www.math.u-bordeaux1.fr/~kbelabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux1.fr/  [PARI/GP]