Product over primes
It is possible in Maxima to define pproduct which is the product over primes, similar to ordinary product(). Because I want the evaluation rule of the arguments of pproduct to be the same as product, I used buildq.
Also, the texput is used to define the output of TeX so that it can be rendered as expected in Imaxima. You can obtain the file pproduct.mac from here.
Maxima 5.20.0 http://maxima.sourceforge.net
using Lisp CMU Common Lisp 19f (19F)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) block(load(("/Users/yasube/Programming/imaxima-imath/imaxima.lisp")), linenum:0)$
(%i1) pproduct(e, var, pmax) ::=
if integerp(pmax)
then buildq([e:e,v:var,pm:pmax], block([res:1],for v:next_prime(1) while (v else apply(nounify(pproduct),[e,var,pmax])$
(%i2) texput(nounify(pproduct),
lambda([arglist], block([e,v,pm],[e,v,pm]:args(arglist),
if (pm=inf) then
concat("\\prod_{",tex1(v) ,":prime}",tex1(e))
else
concat("\\prod_{",tex1(v) ,":prime <",tex1(pm),"}",tex1(e)))))$
The function pproduct can be used to write down the famous Euler product of the Riemann zeta function.
(%i3) zeta(s)=pproduct(1/(1-p^(-s)),p,inf);
(%i4) subst(10,inf,rhs(%));
(%i5) ev(%,nouns);
(%i6)