Ask Your Question

Coefficients of infinite polynomial products

asked 2013-08-05 10:29:33 +0200

Blackadder gravatar image

updated 2013-08-05 12:36:01 +0200

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 flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-08-05 11:42:43 +0200

Luca gravatar image

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

sage: prod(range(1,42))

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]
edit flag offensive delete link 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.

Blackadder gravatar imageBlackadder ( 2013-08-05 12:36:58 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-08-05 10:29:33 +0200

Seen: 1,084 times

Last updated: Aug 05 '13