Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

For finite products you can use the function prod(), like this:

sage: prod(range(1,42))
33452526613163807108170062053440751665152000000000L

What do you mean by "compute K number of times"?

There certainly is not a generic function to compute infinite product, but there might be functions to do what you have in mind. Have a look at the documentation of eta and EtaProduct, you can use the ? syntax:

sage: eta?
...
sage: EtaProduct?

unfortunately, eta seems to accept only complex arguments.

You can use the function gp() to enter Pari code

sage: a = gp("a(n)=local(A); if(n<0, 0, A=x*O(x^n); polcoeff(eta(x^2+A)^5*eta(x^8+A)/(eta(x+A)^2*eta(x^4+A)), n))")
sage: [a(i) for i in range(10)]
[1, 2, 0, 0, 1, -2, 0, 0, -4, -2]