# Coefficients of infinite polynomial products

I would first like to ask if there are commands for computing infinite products,

$$eg.\quad g=q \prod_{n=1}^{\infty} (1-q^{8n})(1-q^{16n}).$$

If not, are there commands for finite products then? How do you compute $$\quad g=q \prod_{n=1}^{N} (1-q^{8n})(1-q^{16n})?$$

Basically, I'm only interested in the coefficients of $g\theta_2$ and $g\theta_4$ where $g$ is as above and $\theta_t=\sum^{\infty}_{-\infty}q^{tn^2}$.

This link to OEIS seems to have a code for generating $g\theta_2$ in PARI, I always thought that SAGE is able to call pari, but I'm unable to perform the command on SAGE.

I'll appreciate it if anyone can advise me how best to do this or direct me to any resources, thanks!

edit retag close merge delete

Sort by » oldest newest most voted

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]

more

Hi Luca, thanks for answering. This is what I was looking for. As to your question, I've edited what I meant. Hopefully that would clear up any confusion.