ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 30 Dec 2021 11:36:46 +0100Computing coefficients of certain function (Euler function $\phi(q)$) that is related to Eta-quotientshttps://ask.sagemath.org/question/60429/computing-coefficients-of-certain-function-euler-function-phiq-that-is-related-to-eta-quotients/**Edit**: I find an online Sage engine [here][4] (https ://sagecell .sagemath .org/).
Also, someone asked [this question][3] (https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/) a long time ago. If I can run a code for that question in this online Sage engine, then I can handle my problem. But when I write this code (that is suggested in the answer to that question)
PSR.<q> = PowerSeriesRing( QQ, default_prec=20 )
f = qexp_eta( PSR, 20 )
f(q^{24})
it gives me some errors as output:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-2a3833019b43> in <module>
1 PSR = PowerSeriesRing( QQ, default_prec=Integer(20) , names=('q',)); (q,) = PSR._first_ngens(1)
----> 2 f = qexp_eta( PSR, Integer(20) )
3 f(q**{Integer(24)})
NameError: name 'qexp_eta' is not defined
> What is the problem with the code in the answer to that question? How can I write a code in that online Sage engine for the $q$-expansion of $\dfrac{\eta(z)}{\eta(4z)\eta(2z)}$? Or, for simplicity how, how can I write a code in that online Sage engine for the $q$-expansion of $\dfrac{\eta(z)}{\eta(2z)}$?
----------
----------
----------
I know that my question is very simple, but I can not handle it myself. Also, I do not know whether it is a suitable question for this site or not, because I want to calculate with Magma. I read the other questions about "eta_products", for example [this question][2] (https ://ask .sagemath .org/question/10413/coefficients-of-infinite-polynomial-products/), or [this question][3] (https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/) (I can't send linky texts because "my karma is insufficient to publish links", and if someone tries to edit my question, and fix the links **at the end of my post**, then these texts become linky automatically; also I don't know why the linky texts are referring to my question), but at the moment I do not have a system of my own on which I am allowed to install and run Sage. (The purpose of my question, is exactly the same as the question entitled "Sage function with functionality of series command from Maple.", but I am trying to do it in Magma)
----------
----------
I want to calculate the $n^{\text{th}}$-Fourier coefficient of some functions that are closed to $\eta$-quotients, in fact some functions that are very similar to [Euler function][1] $\phi(q)=\prod_{i=1}^{\infty}(1-q^{i})$, but not necessarily the same. (Notice that $\phi(q^l)=\prod_{i=1}^{\infty}(1-q^{il})$)
For instance, given positive integers $k, K, l, L$, with $K \mid k$ and $L \mid l$. I want to calculate the $n^{\text{th}}$-Fourier coefficient of $\dfrac{\phi(q^K)\phi(q^L)}{\phi(q^k)\phi(q^l)}$ or $\dfrac{\phi(q)\phi(q^K)\phi(q)\phi(q^L)}{\phi(q^k)\phi(q^l)}$ or some other types of
$\dfrac{\prod_{j=1}^{T}\phi(q^{L_j})^{A_j}}{\prod_{j=1}^{t}\phi(q^{l_j})^{a_j}}$ for suitable positive integers, and some other quotients that are based on some other functions that have some similarity with [Euler function][1].
----------
----------
**My question**: Now forget Euler function, and whatever I've said.
>>> If I know how can I calculate the $n^{\text{th}}$-Fourier coefficient of
$$\dfrac{\prod_{i=1}^{\infty}\Bigg((1-q^{iK})(1-q^{iL})\Bigg)}{\prod_{i=1}^{\infty}\Bigg((1-q^{ik})(1-q^{il})\Bigg)},$$
then I can calculate the $n^{\text{th}}$-Fourier coefficient of the others. (The product $\dfrac{\prod_{i=1}^{\infty}\Bigg((1-q^{iK})(1-q^{iL})\Bigg)}{\prod_{i=1}^{\infty}\Bigg((1-q^{ik})(1-q^{il})\Bigg)}$ does not depend on $i$, and $i$ is just a counter.)
----------
----------
----------
**My attempts in Magma** (My codes were not colorful, but now they are colorful; I don't know what's happened):
- I can calculate the coefficients of a polynomial:
Coefficient(5*x^4+4*x^3+3*x^2+2*x+1, 2);
- also, I can do some other things like:
PQ<x> := PowerSeriesRing(RationalField());
f := (1-x) / (1-x^2); Coefficients(f);
- also, I can define this (but this isn't going to work):
f := func< N, q | &*[1 - q^(i) : i in [1..N]] >;
----------
----------
- This code almost works:
PQ<x> := PowerSeriesRing(RationalField());
N :=100; f := func< x | &*[(1 - x^(i)) : i in [1..N]] >;
F :=(f(x^2)*f(x^3))/(f(x)*f(x)); Coefficients(F);
- but based upon the previous code, it is hard to find the $n^{\text{th}}$-coefficient, and this one is a little bit better:
PQ<x> := PowerSeriesRing(RationalField());
N :=30; f := func< x | &*[(1 - x^(i)) : i in [1..N]] >;
(f(x^2)*f(x^3))/(f(x)*f(x));
But this code is not interesting either, because for example to calculate the $20^{\text{th}}$ coefficient, we need to consider $N$ large enough ($20 \leq N$), and then do the multiplication, and then search for the term $x^n$, and its coefficient.
[1]: https ://en .wikipedia .org/wiki/Euler_function
[2]: https ://ask .sagemath .org/question/10413/coefficients-of-infinite-polynomial-products/
[3]: https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/
[4]: https ://sagecell .sagemath .org/Sat, 25 Dec 2021 16:20:22 +0100https://ask.sagemath.org/question/60429/computing-coefficients-of-certain-function-euler-function-phiq-that-is-related-to-eta-quotients/Comment by Saber for <p><strong>Edit</strong>: I find an online Sage engine <a href="https ://sagecell .sagemath .org/">here</a> (https ://sagecell .sagemath .org/).
Also, someone asked <a href="https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/">this question</a> (https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/) a long time ago. If I can run a code for that question in this online Sage engine, then I can handle my problem. But when I write this code (that is suggested in the answer to that question) </p>
<pre><code> PSR.<q> = PowerSeriesRing( QQ, default_prec=20 )
f = qexp_eta( PSR, 20 )
f(q^{24})
</code></pre>
<p>it gives me some errors as output: </p>
<pre><code> ---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-2a3833019b43> in <module>
1 PSR = PowerSeriesRing( QQ, default_prec=Integer(20) , names=('q',)); (q,) = PSR._first_ngens(1)
----> 2 f = qexp_eta( PSR, Integer(20) )
3 f(q**{Integer(24)})
NameError: name 'qexp_eta' is not defined
</code></pre>
<blockquote>
<p>What is the problem with the code in the answer to that question? How can I write a code in that online Sage engine for the $q$-expansion of $\dfrac{\eta(z)}{\eta(4z)\eta(2z)}$? Or, for simplicity how, how can I write a code in that online Sage engine for the $q$-expansion of $\dfrac{\eta(z)}{\eta(2z)}$? </p>
</blockquote>
<hr>
<hr>
<hr>
<p>I know that my question is very simple, but I can not handle it myself. Also, I do not know whether it is a suitable question for this site or not, because I want to calculate with Magma. I read the other questions about "eta_products", for example <a href="https ://ask .sagemath .org/question/10413/coefficients-of-infinite-polynomial-products/">this question</a> (https ://ask .sagemath .org/question/10413/coefficients-of-infinite-polynomial-products/), or <a href="https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/">this question</a> (https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/) (I can't send linky texts because "my karma is insufficient to publish links", and if someone tries to edit my question, and fix the links <strong>at the end of my post</strong>, then these texts become linky automatically; also I don't know why the linky texts are referring to my question), but at the moment I do not have a system of my own on which I am allowed to install and run Sage. (The purpose of my question, is exactly the same as the question entitled "Sage function with functionality of series command from Maple.", but I am trying to do it in Magma)</p>
<hr>
<hr>
<p>I want to calculate the $n^{\text{th}}$-Fourier coefficient of some functions that are closed to $\eta$-quotients, in fact some functions that are very similar to <a href="https ://en .wikipedia .org/wiki/Euler_function">Euler function</a> $\phi(q)=\prod_{i=1}^{\infty}(1-q^{i})$, but not necessarily the same. (Notice that $\phi(q^l)=\prod_{i=1}^{\infty}(1-q^{il})$) </p>
<p>For instance, given positive integers $k, K, l, L$, with $K \mid k$ and $L \mid l$. I want to calculate the $n^{\text{th}}$-Fourier coefficient of $\dfrac{\phi(q^K)\phi(q^L)}{\phi(q^k)\phi(q^l)}$ or $\dfrac{\phi(q)\phi(q^K)\phi(q)\phi(q^L)}{\phi(q^k)\phi(q^l)}$ or some other types of
$\dfrac{\prod_{j=1}^{T}\phi(q^{L_j})^{A_j}}{\prod_{j=1}^{t}\phi(q^{l_j})^{a_j}}$ for suitable positive integers, and some other quotients that are based on some other functions that have some similarity with <a href="https ://en .wikipedia .org/wiki/Euler_function">Euler function</a>. </p>
<hr>
<hr>
<p><strong>My question</strong>: Now forget Euler function, and whatever I've said. </p>
<blockquote>
<blockquote>
<blockquote>
<p>If I know how can I calculate the $n^{\text{th}}$-Fourier coefficient of
$$\dfrac{\prod_{i=1}^{\infty}\Bigg((1-q^{iK})(1-q^{iL})\Bigg)}{\prod_{i=1}^{\infty}\Bigg((1-q^{ik})(1-q^{il})\Bigg)},$$
then I can calculate the $n^{\text{th}}$-Fourier coefficient of the others. (The product $\dfrac{\prod_{i=1}^{\infty}\Bigg((1-q^{iK})(1-q^{iL})\Bigg)}{\prod_{i=1}^{\infty}\Bigg((1-q^{ik})(1-q^{il})\Bigg)}$ does not depend on $i$, and $i$ is just a counter.)</p>
</blockquote>
</blockquote>
</blockquote>
<hr>
<hr>
<hr>
<p><strong>My attempts in Magma</strong> (My codes were not colorful, but now they are colorful; I don't know what's happened): </p>
<ul>
<li><p>I can calculate the coefficients of a polynomial: </p>
<pre><code>Coefficient(5*x^4+4*x^3+3*x^2+2*x+1, 2);
</code></pre></li>
<li><p>also, I can do some other things like: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
f := (1-x) / (1-x^2); Coefficients(f);
</code></pre></li>
<li><p>also, I can define this (but this isn't going to work): </p>
<pre><code>f := func< N, q | &*[1 - q^(i) : i in [1..N]] >;
</code></pre></li>
</ul>
<hr>
<hr>
<ul>
<li><p>This code almost works: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
N :=100; f := func< x | &*[(1 - x^(i)) : i in [1..N]] >;
F :=(f(x^2)*f(x^3))/(f(x)*f(x)); Coefficients(F);
</code></pre></li>
<li><p>but based upon the previous code, it is hard to find the $n^{\text{th}}$-coefficient, and this one is a little bit better: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
N :=30; f := func< x | &*[(1 - x^(i)) : i in [1..N]] >;
(f(x^2)*f(x^3))/(f(x)*f(x));
</code></pre></li>
</ul>
<p>But this code is not interesting either, because for example to calculate the $20^{\text{th}}$ coefficient, we need to consider $N$ large enough ($20 \leq N$), and then do the multiplication, and then search for the term $x^n$, and its coefficient. </p>
https://ask.sagemath.org/question/60429/computing-coefficients-of-certain-function-euler-function-phiq-that-is-related-to-eta-quotients/?comment=60463#post-id-60463@slelievre The problem was: I wrote `f(q^{24})`, and when I replaced it with `f(q^(24))`, it worked. Thanks for your patience.Mon, 27 Dec 2021 16:58:35 +0100https://ask.sagemath.org/question/60429/computing-coefficients-of-certain-function-euler-function-phiq-that-is-related-to-eta-quotients/?comment=60463#post-id-60463Comment by slelievre for <p><strong>Edit</strong>: I find an online Sage engine <a href="https ://sagecell .sagemath .org/">here</a> (https ://sagecell .sagemath .org/).
Also, someone asked <a href="https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/">this question</a> (https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/) a long time ago. If I can run a code for that question in this online Sage engine, then I can handle my problem. But when I write this code (that is suggested in the answer to that question) </p>
<pre><code> PSR.<q> = PowerSeriesRing( QQ, default_prec=20 )
f = qexp_eta( PSR, 20 )
f(q^{24})
</code></pre>
<p>it gives me some errors as output: </p>
<pre><code> ---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-2a3833019b43> in <module>
1 PSR = PowerSeriesRing( QQ, default_prec=Integer(20) , names=('q',)); (q,) = PSR._first_ngens(1)
----> 2 f = qexp_eta( PSR, Integer(20) )
3 f(q**{Integer(24)})
NameError: name 'qexp_eta' is not defined
</code></pre>
<blockquote>
<p>What is the problem with the code in the answer to that question? How can I write a code in that online Sage engine for the $q$-expansion of $\dfrac{\eta(z)}{\eta(4z)\eta(2z)}$? Or, for simplicity how, how can I write a code in that online Sage engine for the $q$-expansion of $\dfrac{\eta(z)}{\eta(2z)}$? </p>
</blockquote>
<hr>
<hr>
<hr>
<p>I know that my question is very simple, but I can not handle it myself. Also, I do not know whether it is a suitable question for this site or not, because I want to calculate with Magma. I read the other questions about "eta_products", for example <a href="https ://ask .sagemath .org/question/10413/coefficients-of-infinite-polynomial-products/">this question</a> (https ://ask .sagemath .org/question/10413/coefficients-of-infinite-polynomial-products/), or <a href="https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/">this question</a> (https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/) (I can't send linky texts because "my karma is insufficient to publish links", and if someone tries to edit my question, and fix the links <strong>at the end of my post</strong>, then these texts become linky automatically; also I don't know why the linky texts are referring to my question), but at the moment I do not have a system of my own on which I am allowed to install and run Sage. (The purpose of my question, is exactly the same as the question entitled "Sage function with functionality of series command from Maple.", but I am trying to do it in Magma)</p>
<hr>
<hr>
<p>I want to calculate the $n^{\text{th}}$-Fourier coefficient of some functions that are closed to $\eta$-quotients, in fact some functions that are very similar to <a href="https ://en .wikipedia .org/wiki/Euler_function">Euler function</a> $\phi(q)=\prod_{i=1}^{\infty}(1-q^{i})$, but not necessarily the same. (Notice that $\phi(q^l)=\prod_{i=1}^{\infty}(1-q^{il})$) </p>
<p>For instance, given positive integers $k, K, l, L$, with $K \mid k$ and $L \mid l$. I want to calculate the $n^{\text{th}}$-Fourier coefficient of $\dfrac{\phi(q^K)\phi(q^L)}{\phi(q^k)\phi(q^l)}$ or $\dfrac{\phi(q)\phi(q^K)\phi(q)\phi(q^L)}{\phi(q^k)\phi(q^l)}$ or some other types of
$\dfrac{\prod_{j=1}^{T}\phi(q^{L_j})^{A_j}}{\prod_{j=1}^{t}\phi(q^{l_j})^{a_j}}$ for suitable positive integers, and some other quotients that are based on some other functions that have some similarity with <a href="https ://en .wikipedia .org/wiki/Euler_function">Euler function</a>. </p>
<hr>
<hr>
<p><strong>My question</strong>: Now forget Euler function, and whatever I've said. </p>
<blockquote>
<blockquote>
<blockquote>
<p>If I know how can I calculate the $n^{\text{th}}$-Fourier coefficient of
$$\dfrac{\prod_{i=1}^{\infty}\Bigg((1-q^{iK})(1-q^{iL})\Bigg)}{\prod_{i=1}^{\infty}\Bigg((1-q^{ik})(1-q^{il})\Bigg)},$$
then I can calculate the $n^{\text{th}}$-Fourier coefficient of the others. (The product $\dfrac{\prod_{i=1}^{\infty}\Bigg((1-q^{iK})(1-q^{iL})\Bigg)}{\prod_{i=1}^{\infty}\Bigg((1-q^{ik})(1-q^{il})\Bigg)}$ does not depend on $i$, and $i$ is just a counter.)</p>
</blockquote>
</blockquote>
</blockquote>
<hr>
<hr>
<hr>
<p><strong>My attempts in Magma</strong> (My codes were not colorful, but now they are colorful; I don't know what's happened): </p>
<ul>
<li><p>I can calculate the coefficients of a polynomial: </p>
<pre><code>Coefficient(5*x^4+4*x^3+3*x^2+2*x+1, 2);
</code></pre></li>
<li><p>also, I can do some other things like: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
f := (1-x) / (1-x^2); Coefficients(f);
</code></pre></li>
<li><p>also, I can define this (but this isn't going to work): </p>
<pre><code>f := func< N, q | &*[1 - q^(i) : i in [1..N]] >;
</code></pre></li>
</ul>
<hr>
<hr>
<ul>
<li><p>This code almost works: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
N :=100; f := func< x | &*[(1 - x^(i)) : i in [1..N]] >;
F :=(f(x^2)*f(x^3))/(f(x)*f(x)); Coefficients(F);
</code></pre></li>
<li><p>but based upon the previous code, it is hard to find the $n^{\text{th}}$-coefficient, and this one is a little bit better: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
N :=30; f := func< x | &*[(1 - x^(i)) : i in [1..N]] >;
(f(x^2)*f(x^3))/(f(x)*f(x));
</code></pre></li>
</ul>
<p>But this code is not interesting either, because for example to calculate the $20^{\text{th}}$ coefficient, we need to consider $N$ large enough ($20 \leq N$), and then do the multiplication, and then search for the term $x^n$, and its coefficient. </p>
https://ask.sagemath.org/question/60429/computing-coefficients-of-certain-function-euler-function-phiq-that-is-related-to-eta-quotients/?comment=60469#post-id-60469Well done. You can even use `f(q^24)`.Tue, 28 Dec 2021 07:03:28 +0100https://ask.sagemath.org/question/60429/computing-coefficients-of-certain-function-euler-function-phiq-that-is-related-to-eta-quotients/?comment=60469#post-id-60469Comment by Saber for <p><strong>Edit</strong>: I find an online Sage engine <a href="https ://sagecell .sagemath .org/">here</a> (https ://sagecell .sagemath .org/).
Also, someone asked <a href="https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/">this question</a> (https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/) a long time ago. If I can run a code for that question in this online Sage engine, then I can handle my problem. But when I write this code (that is suggested in the answer to that question) </p>
<pre><code> PSR.<q> = PowerSeriesRing( QQ, default_prec=20 )
f = qexp_eta( PSR, 20 )
f(q^{24})
</code></pre>
<p>it gives me some errors as output: </p>
<pre><code> ---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-2a3833019b43> in <module>
1 PSR = PowerSeriesRing( QQ, default_prec=Integer(20) , names=('q',)); (q,) = PSR._first_ngens(1)
----> 2 f = qexp_eta( PSR, Integer(20) )
3 f(q**{Integer(24)})
NameError: name 'qexp_eta' is not defined
</code></pre>
<blockquote>
<p>What is the problem with the code in the answer to that question? How can I write a code in that online Sage engine for the $q$-expansion of $\dfrac{\eta(z)}{\eta(4z)\eta(2z)}$? Or, for simplicity how, how can I write a code in that online Sage engine for the $q$-expansion of $\dfrac{\eta(z)}{\eta(2z)}$? </p>
</blockquote>
<hr>
<hr>
<hr>
<p>I know that my question is very simple, but I can not handle it myself. Also, I do not know whether it is a suitable question for this site or not, because I want to calculate with Magma. I read the other questions about "eta_products", for example <a href="https ://ask .sagemath .org/question/10413/coefficients-of-infinite-polynomial-products/">this question</a> (https ://ask .sagemath .org/question/10413/coefficients-of-infinite-polynomial-products/), or <a href="https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/">this question</a> (https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/) (I can't send linky texts because "my karma is insufficient to publish links", and if someone tries to edit my question, and fix the links <strong>at the end of my post</strong>, then these texts become linky automatically; also I don't know why the linky texts are referring to my question), but at the moment I do not have a system of my own on which I am allowed to install and run Sage. (The purpose of my question, is exactly the same as the question entitled "Sage function with functionality of series command from Maple.", but I am trying to do it in Magma)</p>
<hr>
<hr>
<p>I want to calculate the $n^{\text{th}}$-Fourier coefficient of some functions that are closed to $\eta$-quotients, in fact some functions that are very similar to <a href="https ://en .wikipedia .org/wiki/Euler_function">Euler function</a> $\phi(q)=\prod_{i=1}^{\infty}(1-q^{i})$, but not necessarily the same. (Notice that $\phi(q^l)=\prod_{i=1}^{\infty}(1-q^{il})$) </p>
<p>For instance, given positive integers $k, K, l, L$, with $K \mid k$ and $L \mid l$. I want to calculate the $n^{\text{th}}$-Fourier coefficient of $\dfrac{\phi(q^K)\phi(q^L)}{\phi(q^k)\phi(q^l)}$ or $\dfrac{\phi(q)\phi(q^K)\phi(q)\phi(q^L)}{\phi(q^k)\phi(q^l)}$ or some other types of
$\dfrac{\prod_{j=1}^{T}\phi(q^{L_j})^{A_j}}{\prod_{j=1}^{t}\phi(q^{l_j})^{a_j}}$ for suitable positive integers, and some other quotients that are based on some other functions that have some similarity with <a href="https ://en .wikipedia .org/wiki/Euler_function">Euler function</a>. </p>
<hr>
<hr>
<p><strong>My question</strong>: Now forget Euler function, and whatever I've said. </p>
<blockquote>
<blockquote>
<blockquote>
<p>If I know how can I calculate the $n^{\text{th}}$-Fourier coefficient of
$$\dfrac{\prod_{i=1}^{\infty}\Bigg((1-q^{iK})(1-q^{iL})\Bigg)}{\prod_{i=1}^{\infty}\Bigg((1-q^{ik})(1-q^{il})\Bigg)},$$
then I can calculate the $n^{\text{th}}$-Fourier coefficient of the others. (The product $\dfrac{\prod_{i=1}^{\infty}\Bigg((1-q^{iK})(1-q^{iL})\Bigg)}{\prod_{i=1}^{\infty}\Bigg((1-q^{ik})(1-q^{il})\Bigg)}$ does not depend on $i$, and $i$ is just a counter.)</p>
</blockquote>
</blockquote>
</blockquote>
<hr>
<hr>
<hr>
<p><strong>My attempts in Magma</strong> (My codes were not colorful, but now they are colorful; I don't know what's happened): </p>
<ul>
<li><p>I can calculate the coefficients of a polynomial: </p>
<pre><code>Coefficient(5*x^4+4*x^3+3*x^2+2*x+1, 2);
</code></pre></li>
<li><p>also, I can do some other things like: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
f := (1-x) / (1-x^2); Coefficients(f);
</code></pre></li>
<li><p>also, I can define this (but this isn't going to work): </p>
<pre><code>f := func< N, q | &*[1 - q^(i) : i in [1..N]] >;
</code></pre></li>
</ul>
<hr>
<hr>
<ul>
<li><p>This code almost works: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
N :=100; f := func< x | &*[(1 - x^(i)) : i in [1..N]] >;
F :=(f(x^2)*f(x^3))/(f(x)*f(x)); Coefficients(F);
</code></pre></li>
<li><p>but based upon the previous code, it is hard to find the $n^{\text{th}}$-coefficient, and this one is a little bit better: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
N :=30; f := func< x | &*[(1 - x^(i)) : i in [1..N]] >;
(f(x^2)*f(x^3))/(f(x)*f(x));
</code></pre></li>
</ul>
<p>But this code is not interesting either, because for example to calculate the $20^{\text{th}}$ coefficient, we need to consider $N$ large enough ($20 \leq N$), and then do the multiplication, and then search for the term $x^n$, and its coefficient. </p>
https://ask.sagemath.org/question/60429/computing-coefficients-of-certain-function-euler-function-phiq-that-is-related-to-eta-quotients/?comment=60458#post-id-60458@slelievre Thanks for your patience, I think this solved the problem. I am very thankful for that.Mon, 27 Dec 2021 08:14:00 +0100https://ask.sagemath.org/question/60429/computing-coefficients-of-certain-function-euler-function-phiq-that-is-related-to-eta-quotients/?comment=60458#post-id-60458Comment by slelievre for <p><strong>Edit</strong>: I find an online Sage engine <a href="https ://sagecell .sagemath .org/">here</a> (https ://sagecell .sagemath .org/).
Also, someone asked <a href="https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/">this question</a> (https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/) a long time ago. If I can run a code for that question in this online Sage engine, then I can handle my problem. But when I write this code (that is suggested in the answer to that question) </p>
<pre><code> PSR.<q> = PowerSeriesRing( QQ, default_prec=20 )
f = qexp_eta( PSR, 20 )
f(q^{24})
</code></pre>
<p>it gives me some errors as output: </p>
<pre><code> ---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-2a3833019b43> in <module>
1 PSR = PowerSeriesRing( QQ, default_prec=Integer(20) , names=('q',)); (q,) = PSR._first_ngens(1)
----> 2 f = qexp_eta( PSR, Integer(20) )
3 f(q**{Integer(24)})
NameError: name 'qexp_eta' is not defined
</code></pre>
<blockquote>
<p>What is the problem with the code in the answer to that question? How can I write a code in that online Sage engine for the $q$-expansion of $\dfrac{\eta(z)}{\eta(4z)\eta(2z)}$? Or, for simplicity how, how can I write a code in that online Sage engine for the $q$-expansion of $\dfrac{\eta(z)}{\eta(2z)}$? </p>
</blockquote>
<hr>
<hr>
<hr>
<p>I know that my question is very simple, but I can not handle it myself. Also, I do not know whether it is a suitable question for this site or not, because I want to calculate with Magma. I read the other questions about "eta_products", for example <a href="https ://ask .sagemath .org/question/10413/coefficients-of-infinite-polynomial-products/">this question</a> (https ://ask .sagemath .org/question/10413/coefficients-of-infinite-polynomial-products/), or <a href="https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/">this question</a> (https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/) (I can't send linky texts because "my karma is insufficient to publish links", and if someone tries to edit my question, and fix the links <strong>at the end of my post</strong>, then these texts become linky automatically; also I don't know why the linky texts are referring to my question), but at the moment I do not have a system of my own on which I am allowed to install and run Sage. (The purpose of my question, is exactly the same as the question entitled "Sage function with functionality of series command from Maple.", but I am trying to do it in Magma)</p>
<hr>
<hr>
<p>I want to calculate the $n^{\text{th}}$-Fourier coefficient of some functions that are closed to $\eta$-quotients, in fact some functions that are very similar to <a href="https ://en .wikipedia .org/wiki/Euler_function">Euler function</a> $\phi(q)=\prod_{i=1}^{\infty}(1-q^{i})$, but not necessarily the same. (Notice that $\phi(q^l)=\prod_{i=1}^{\infty}(1-q^{il})$) </p>
<p>For instance, given positive integers $k, K, l, L$, with $K \mid k$ and $L \mid l$. I want to calculate the $n^{\text{th}}$-Fourier coefficient of $\dfrac{\phi(q^K)\phi(q^L)}{\phi(q^k)\phi(q^l)}$ or $\dfrac{\phi(q)\phi(q^K)\phi(q)\phi(q^L)}{\phi(q^k)\phi(q^l)}$ or some other types of
$\dfrac{\prod_{j=1}^{T}\phi(q^{L_j})^{A_j}}{\prod_{j=1}^{t}\phi(q^{l_j})^{a_j}}$ for suitable positive integers, and some other quotients that are based on some other functions that have some similarity with <a href="https ://en .wikipedia .org/wiki/Euler_function">Euler function</a>. </p>
<hr>
<hr>
<p><strong>My question</strong>: Now forget Euler function, and whatever I've said. </p>
<blockquote>
<blockquote>
<blockquote>
<p>If I know how can I calculate the $n^{\text{th}}$-Fourier coefficient of
$$\dfrac{\prod_{i=1}^{\infty}\Bigg((1-q^{iK})(1-q^{iL})\Bigg)}{\prod_{i=1}^{\infty}\Bigg((1-q^{ik})(1-q^{il})\Bigg)},$$
then I can calculate the $n^{\text{th}}$-Fourier coefficient of the others. (The product $\dfrac{\prod_{i=1}^{\infty}\Bigg((1-q^{iK})(1-q^{iL})\Bigg)}{\prod_{i=1}^{\infty}\Bigg((1-q^{ik})(1-q^{il})\Bigg)}$ does not depend on $i$, and $i$ is just a counter.)</p>
</blockquote>
</blockquote>
</blockquote>
<hr>
<hr>
<hr>
<p><strong>My attempts in Magma</strong> (My codes were not colorful, but now they are colorful; I don't know what's happened): </p>
<ul>
<li><p>I can calculate the coefficients of a polynomial: </p>
<pre><code>Coefficient(5*x^4+4*x^3+3*x^2+2*x+1, 2);
</code></pre></li>
<li><p>also, I can do some other things like: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
f := (1-x) / (1-x^2); Coefficients(f);
</code></pre></li>
<li><p>also, I can define this (but this isn't going to work): </p>
<pre><code>f := func< N, q | &*[1 - q^(i) : i in [1..N]] >;
</code></pre></li>
</ul>
<hr>
<hr>
<ul>
<li><p>This code almost works: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
N :=100; f := func< x | &*[(1 - x^(i)) : i in [1..N]] >;
F :=(f(x^2)*f(x^3))/(f(x)*f(x)); Coefficients(F);
</code></pre></li>
<li><p>but based upon the previous code, it is hard to find the $n^{\text{th}}$-coefficient, and this one is a little bit better: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
N :=30; f := func< x | &*[(1 - x^(i)) : i in [1..N]] >;
(f(x^2)*f(x^3))/(f(x)*f(x));
</code></pre></li>
</ul>
<p>But this code is not interesting either, because for example to calculate the $20^{\text{th}}$ coefficient, we need to consider $N$ large enough ($20 \leq N$), and then do the multiplication, and then search for the term $x^n$, and its coefficient. </p>
https://ask.sagemath.org/question/60429/computing-coefficients-of-certain-function-euler-function-phiq-that-is-related-to-eta-quotients/?comment=60454#post-id-60454To use `qexp_eta`, add this line beforehand:
from sage.modular.etaproducts import qexp_etaMon, 27 Dec 2021 01:35:34 +0100https://ask.sagemath.org/question/60429/computing-coefficients-of-certain-function-euler-function-phiq-that-is-related-to-eta-quotients/?comment=60454#post-id-60454Comment by Saber for <p><strong>Edit</strong>: I find an online Sage engine <a href="https ://sagecell .sagemath .org/">here</a> (https ://sagecell .sagemath .org/).
Also, someone asked <a href="https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/">this question</a> (https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/) a long time ago. If I can run a code for that question in this online Sage engine, then I can handle my problem. But when I write this code (that is suggested in the answer to that question) </p>
<pre><code> PSR.<q> = PowerSeriesRing( QQ, default_prec=20 )
f = qexp_eta( PSR, 20 )
f(q^{24})
</code></pre>
<p>it gives me some errors as output: </p>
<pre><code> ---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-2a3833019b43> in <module>
1 PSR = PowerSeriesRing( QQ, default_prec=Integer(20) , names=('q',)); (q,) = PSR._first_ngens(1)
----> 2 f = qexp_eta( PSR, Integer(20) )
3 f(q**{Integer(24)})
NameError: name 'qexp_eta' is not defined
</code></pre>
<blockquote>
<p>What is the problem with the code in the answer to that question? How can I write a code in that online Sage engine for the $q$-expansion of $\dfrac{\eta(z)}{\eta(4z)\eta(2z)}$? Or, for simplicity how, how can I write a code in that online Sage engine for the $q$-expansion of $\dfrac{\eta(z)}{\eta(2z)}$? </p>
</blockquote>
<hr>
<hr>
<hr>
<p>I know that my question is very simple, but I can not handle it myself. Also, I do not know whether it is a suitable question for this site or not, because I want to calculate with Magma. I read the other questions about "eta_products", for example <a href="https ://ask .sagemath .org/question/10413/coefficients-of-infinite-polynomial-products/">this question</a> (https ://ask .sagemath .org/question/10413/coefficients-of-infinite-polynomial-products/), or <a href="https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/">this question</a> (https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/) (I can't send linky texts because "my karma is insufficient to publish links", and if someone tries to edit my question, and fix the links <strong>at the end of my post</strong>, then these texts become linky automatically; also I don't know why the linky texts are referring to my question), but at the moment I do not have a system of my own on which I am allowed to install and run Sage. (The purpose of my question, is exactly the same as the question entitled "Sage function with functionality of series command from Maple.", but I am trying to do it in Magma)</p>
<hr>
<hr>
<p>I want to calculate the $n^{\text{th}}$-Fourier coefficient of some functions that are closed to $\eta$-quotients, in fact some functions that are very similar to <a href="https ://en .wikipedia .org/wiki/Euler_function">Euler function</a> $\phi(q)=\prod_{i=1}^{\infty}(1-q^{i})$, but not necessarily the same. (Notice that $\phi(q^l)=\prod_{i=1}^{\infty}(1-q^{il})$) </p>
<p>For instance, given positive integers $k, K, l, L$, with $K \mid k$ and $L \mid l$. I want to calculate the $n^{\text{th}}$-Fourier coefficient of $\dfrac{\phi(q^K)\phi(q^L)}{\phi(q^k)\phi(q^l)}$ or $\dfrac{\phi(q)\phi(q^K)\phi(q)\phi(q^L)}{\phi(q^k)\phi(q^l)}$ or some other types of
$\dfrac{\prod_{j=1}^{T}\phi(q^{L_j})^{A_j}}{\prod_{j=1}^{t}\phi(q^{l_j})^{a_j}}$ for suitable positive integers, and some other quotients that are based on some other functions that have some similarity with <a href="https ://en .wikipedia .org/wiki/Euler_function">Euler function</a>. </p>
<hr>
<hr>
<p><strong>My question</strong>: Now forget Euler function, and whatever I've said. </p>
<blockquote>
<blockquote>
<blockquote>
<p>If I know how can I calculate the $n^{\text{th}}$-Fourier coefficient of
$$\dfrac{\prod_{i=1}^{\infty}\Bigg((1-q^{iK})(1-q^{iL})\Bigg)}{\prod_{i=1}^{\infty}\Bigg((1-q^{ik})(1-q^{il})\Bigg)},$$
then I can calculate the $n^{\text{th}}$-Fourier coefficient of the others. (The product $\dfrac{\prod_{i=1}^{\infty}\Bigg((1-q^{iK})(1-q^{iL})\Bigg)}{\prod_{i=1}^{\infty}\Bigg((1-q^{ik})(1-q^{il})\Bigg)}$ does not depend on $i$, and $i$ is just a counter.)</p>
</blockquote>
</blockquote>
</blockquote>
<hr>
<hr>
<hr>
<p><strong>My attempts in Magma</strong> (My codes were not colorful, but now they are colorful; I don't know what's happened): </p>
<ul>
<li><p>I can calculate the coefficients of a polynomial: </p>
<pre><code>Coefficient(5*x^4+4*x^3+3*x^2+2*x+1, 2);
</code></pre></li>
<li><p>also, I can do some other things like: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
f := (1-x) / (1-x^2); Coefficients(f);
</code></pre></li>
<li><p>also, I can define this (but this isn't going to work): </p>
<pre><code>f := func< N, q | &*[1 - q^(i) : i in [1..N]] >;
</code></pre></li>
</ul>
<hr>
<hr>
<ul>
<li><p>This code almost works: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
N :=100; f := func< x | &*[(1 - x^(i)) : i in [1..N]] >;
F :=(f(x^2)*f(x^3))/(f(x)*f(x)); Coefficients(F);
</code></pre></li>
<li><p>but based upon the previous code, it is hard to find the $n^{\text{th}}$-coefficient, and this one is a little bit better: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
N :=30; f := func< x | &*[(1 - x^(i)) : i in [1..N]] >;
(f(x^2)*f(x^3))/(f(x)*f(x));
</code></pre></li>
</ul>
<p>But this code is not interesting either, because for example to calculate the $20^{\text{th}}$ coefficient, we need to consider $N$ large enough ($20 \leq N$), and then do the multiplication, and then search for the term $x^n$, and its coefficient. </p>
https://ask.sagemath.org/question/60429/computing-coefficients-of-certain-function-euler-function-phiq-that-is-related-to-eta-quotients/?comment=60436#post-id-60436@slelievre Thanks for your kindness and your patience, and also for the nice trick to insert links.Sat, 25 Dec 2021 21:42:18 +0100https://ask.sagemath.org/question/60429/computing-coefficients-of-certain-function-euler-function-phiq-that-is-related-to-eta-quotients/?comment=60436#post-id-60436Comment by Saber for <p><strong>Edit</strong>: I find an online Sage engine <a href="https ://sagecell .sagemath .org/">here</a> (https ://sagecell .sagemath .org/).
Also, someone asked <a href="https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/">this question</a> (https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/) a long time ago. If I can run a code for that question in this online Sage engine, then I can handle my problem. But when I write this code (that is suggested in the answer to that question) </p>
<pre><code> PSR.<q> = PowerSeriesRing( QQ, default_prec=20 )
f = qexp_eta( PSR, 20 )
f(q^{24})
</code></pre>
<p>it gives me some errors as output: </p>
<pre><code> ---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-2a3833019b43> in <module>
1 PSR = PowerSeriesRing( QQ, default_prec=Integer(20) , names=('q',)); (q,) = PSR._first_ngens(1)
----> 2 f = qexp_eta( PSR, Integer(20) )
3 f(q**{Integer(24)})
NameError: name 'qexp_eta' is not defined
</code></pre>
<blockquote>
<p>What is the problem with the code in the answer to that question? How can I write a code in that online Sage engine for the $q$-expansion of $\dfrac{\eta(z)}{\eta(4z)\eta(2z)}$? Or, for simplicity how, how can I write a code in that online Sage engine for the $q$-expansion of $\dfrac{\eta(z)}{\eta(2z)}$? </p>
</blockquote>
<hr>
<hr>
<hr>
<p>I know that my question is very simple, but I can not handle it myself. Also, I do not know whether it is a suitable question for this site or not, because I want to calculate with Magma. I read the other questions about "eta_products", for example <a href="https ://ask .sagemath .org/question/10413/coefficients-of-infinite-polynomial-products/">this question</a> (https ://ask .sagemath .org/question/10413/coefficients-of-infinite-polynomial-products/), or <a href="https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/">this question</a> (https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/) (I can't send linky texts because "my karma is insufficient to publish links", and if someone tries to edit my question, and fix the links <strong>at the end of my post</strong>, then these texts become linky automatically; also I don't know why the linky texts are referring to my question), but at the moment I do not have a system of my own on which I am allowed to install and run Sage. (The purpose of my question, is exactly the same as the question entitled "Sage function with functionality of series command from Maple.", but I am trying to do it in Magma)</p>
<hr>
<hr>
<p>I want to calculate the $n^{\text{th}}$-Fourier coefficient of some functions that are closed to $\eta$-quotients, in fact some functions that are very similar to <a href="https ://en .wikipedia .org/wiki/Euler_function">Euler function</a> $\phi(q)=\prod_{i=1}^{\infty}(1-q^{i})$, but not necessarily the same. (Notice that $\phi(q^l)=\prod_{i=1}^{\infty}(1-q^{il})$) </p>
<p>For instance, given positive integers $k, K, l, L$, with $K \mid k$ and $L \mid l$. I want to calculate the $n^{\text{th}}$-Fourier coefficient of $\dfrac{\phi(q^K)\phi(q^L)}{\phi(q^k)\phi(q^l)}$ or $\dfrac{\phi(q)\phi(q^K)\phi(q)\phi(q^L)}{\phi(q^k)\phi(q^l)}$ or some other types of
$\dfrac{\prod_{j=1}^{T}\phi(q^{L_j})^{A_j}}{\prod_{j=1}^{t}\phi(q^{l_j})^{a_j}}$ for suitable positive integers, and some other quotients that are based on some other functions that have some similarity with <a href="https ://en .wikipedia .org/wiki/Euler_function">Euler function</a>. </p>
<hr>
<hr>
<p><strong>My question</strong>: Now forget Euler function, and whatever I've said. </p>
<blockquote>
<blockquote>
<blockquote>
<p>If I know how can I calculate the $n^{\text{th}}$-Fourier coefficient of
$$\dfrac{\prod_{i=1}^{\infty}\Bigg((1-q^{iK})(1-q^{iL})\Bigg)}{\prod_{i=1}^{\infty}\Bigg((1-q^{ik})(1-q^{il})\Bigg)},$$
then I can calculate the $n^{\text{th}}$-Fourier coefficient of the others. (The product $\dfrac{\prod_{i=1}^{\infty}\Bigg((1-q^{iK})(1-q^{iL})\Bigg)}{\prod_{i=1}^{\infty}\Bigg((1-q^{ik})(1-q^{il})\Bigg)}$ does not depend on $i$, and $i$ is just a counter.)</p>
</blockquote>
</blockquote>
</blockquote>
<hr>
<hr>
<hr>
<p><strong>My attempts in Magma</strong> (My codes were not colorful, but now they are colorful; I don't know what's happened): </p>
<ul>
<li><p>I can calculate the coefficients of a polynomial: </p>
<pre><code>Coefficient(5*x^4+4*x^3+3*x^2+2*x+1, 2);
</code></pre></li>
<li><p>also, I can do some other things like: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
f := (1-x) / (1-x^2); Coefficients(f);
</code></pre></li>
<li><p>also, I can define this (but this isn't going to work): </p>
<pre><code>f := func< N, q | &*[1 - q^(i) : i in [1..N]] >;
</code></pre></li>
</ul>
<hr>
<hr>
<ul>
<li><p>This code almost works: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
N :=100; f := func< x | &*[(1 - x^(i)) : i in [1..N]] >;
F :=(f(x^2)*f(x^3))/(f(x)*f(x)); Coefficients(F);
</code></pre></li>
<li><p>but based upon the previous code, it is hard to find the $n^{\text{th}}$-coefficient, and this one is a little bit better: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
N :=30; f := func< x | &*[(1 - x^(i)) : i in [1..N]] >;
(f(x^2)*f(x^3))/(f(x)*f(x));
</code></pre></li>
</ul>
<p>But this code is not interesting either, because for example to calculate the $20^{\text{th}}$ coefficient, we need to consider $N$ large enough ($20 \leq N$), and then do the multiplication, and then search for the term $x^n$, and its coefficient. </p>
https://ask.sagemath.org/question/60429/computing-coefficients-of-certain-function-euler-function-phiq-that-is-related-to-eta-quotients/?comment=60437#post-id-60437@Max Alekseyev Sorry, I forgot to write the counter in the powers, Thank you. I edited it, and to be more clear I replace the counter with "$i$" (instead of "$m$").Sat, 25 Dec 2021 21:49:12 +0100https://ask.sagemath.org/question/60429/computing-coefficients-of-certain-function-euler-function-phiq-that-is-related-to-eta-quotients/?comment=60437#post-id-60437Comment by Max Alekseyev for <p><strong>Edit</strong>: I find an online Sage engine <a href="https ://sagecell .sagemath .org/">here</a> (https ://sagecell .sagemath .org/).
Also, someone asked <a href="https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/">this question</a> (https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/) a long time ago. If I can run a code for that question in this online Sage engine, then I can handle my problem. But when I write this code (that is suggested in the answer to that question) </p>
<pre><code> PSR.<q> = PowerSeriesRing( QQ, default_prec=20 )
f = qexp_eta( PSR, 20 )
f(q^{24})
</code></pre>
<p>it gives me some errors as output: </p>
<pre><code> ---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-2a3833019b43> in <module>
1 PSR = PowerSeriesRing( QQ, default_prec=Integer(20) , names=('q',)); (q,) = PSR._first_ngens(1)
----> 2 f = qexp_eta( PSR, Integer(20) )
3 f(q**{Integer(24)})
NameError: name 'qexp_eta' is not defined
</code></pre>
<blockquote>
<p>What is the problem with the code in the answer to that question? How can I write a code in that online Sage engine for the $q$-expansion of $\dfrac{\eta(z)}{\eta(4z)\eta(2z)}$? Or, for simplicity how, how can I write a code in that online Sage engine for the $q$-expansion of $\dfrac{\eta(z)}{\eta(2z)}$? </p>
</blockquote>
<hr>
<hr>
<hr>
<p>I know that my question is very simple, but I can not handle it myself. Also, I do not know whether it is a suitable question for this site or not, because I want to calculate with Magma. I read the other questions about "eta_products", for example <a href="https ://ask .sagemath .org/question/10413/coefficients-of-infinite-polynomial-products/">this question</a> (https ://ask .sagemath .org/question/10413/coefficients-of-infinite-polynomial-products/), or <a href="https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/">this question</a> (https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/) (I can't send linky texts because "my karma is insufficient to publish links", and if someone tries to edit my question, and fix the links <strong>at the end of my post</strong>, then these texts become linky automatically; also I don't know why the linky texts are referring to my question), but at the moment I do not have a system of my own on which I am allowed to install and run Sage. (The purpose of my question, is exactly the same as the question entitled "Sage function with functionality of series command from Maple.", but I am trying to do it in Magma)</p>
<hr>
<hr>
<p>I want to calculate the $n^{\text{th}}$-Fourier coefficient of some functions that are closed to $\eta$-quotients, in fact some functions that are very similar to <a href="https ://en .wikipedia .org/wiki/Euler_function">Euler function</a> $\phi(q)=\prod_{i=1}^{\infty}(1-q^{i})$, but not necessarily the same. (Notice that $\phi(q^l)=\prod_{i=1}^{\infty}(1-q^{il})$) </p>
<p>For instance, given positive integers $k, K, l, L$, with $K \mid k$ and $L \mid l$. I want to calculate the $n^{\text{th}}$-Fourier coefficient of $\dfrac{\phi(q^K)\phi(q^L)}{\phi(q^k)\phi(q^l)}$ or $\dfrac{\phi(q)\phi(q^K)\phi(q)\phi(q^L)}{\phi(q^k)\phi(q^l)}$ or some other types of
$\dfrac{\prod_{j=1}^{T}\phi(q^{L_j})^{A_j}}{\prod_{j=1}^{t}\phi(q^{l_j})^{a_j}}$ for suitable positive integers, and some other quotients that are based on some other functions that have some similarity with <a href="https ://en .wikipedia .org/wiki/Euler_function">Euler function</a>. </p>
<hr>
<hr>
<p><strong>My question</strong>: Now forget Euler function, and whatever I've said. </p>
<blockquote>
<blockquote>
<blockquote>
<p>If I know how can I calculate the $n^{\text{th}}$-Fourier coefficient of
$$\dfrac{\prod_{i=1}^{\infty}\Bigg((1-q^{iK})(1-q^{iL})\Bigg)}{\prod_{i=1}^{\infty}\Bigg((1-q^{ik})(1-q^{il})\Bigg)},$$
then I can calculate the $n^{\text{th}}$-Fourier coefficient of the others. (The product $\dfrac{\prod_{i=1}^{\infty}\Bigg((1-q^{iK})(1-q^{iL})\Bigg)}{\prod_{i=1}^{\infty}\Bigg((1-q^{ik})(1-q^{il})\Bigg)}$ does not depend on $i$, and $i$ is just a counter.)</p>
</blockquote>
</blockquote>
</blockquote>
<hr>
<hr>
<hr>
<p><strong>My attempts in Magma</strong> (My codes were not colorful, but now they are colorful; I don't know what's happened): </p>
<ul>
<li><p>I can calculate the coefficients of a polynomial: </p>
<pre><code>Coefficient(5*x^4+4*x^3+3*x^2+2*x+1, 2);
</code></pre></li>
<li><p>also, I can do some other things like: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
f := (1-x) / (1-x^2); Coefficients(f);
</code></pre></li>
<li><p>also, I can define this (but this isn't going to work): </p>
<pre><code>f := func< N, q | &*[1 - q^(i) : i in [1..N]] >;
</code></pre></li>
</ul>
<hr>
<hr>
<ul>
<li><p>This code almost works: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
N :=100; f := func< x | &*[(1 - x^(i)) : i in [1..N]] >;
F :=(f(x^2)*f(x^3))/(f(x)*f(x)); Coefficients(F);
</code></pre></li>
<li><p>but based upon the previous code, it is hard to find the $n^{\text{th}}$-coefficient, and this one is a little bit better: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
N :=30; f := func< x | &*[(1 - x^(i)) : i in [1..N]] >;
(f(x^2)*f(x^3))/(f(x)*f(x));
</code></pre></li>
</ul>
<p>But this code is not interesting either, because for example to calculate the $20^{\text{th}}$ coefficient, we need to consider $N$ large enough ($20 \leq N$), and then do the multiplication, and then search for the term $x^n$, and its coefficient. </p>
https://ask.sagemath.org/question/60429/computing-coefficients-of-certain-function-euler-function-phiq-that-is-related-to-eta-quotients/?comment=60435#post-id-60435The product terms in question do not depend on $m$ - please clarify.Sat, 25 Dec 2021 21:36:00 +0100https://ask.sagemath.org/question/60429/computing-coefficients-of-certain-function-euler-function-phiq-that-is-related-to-eta-quotients/?comment=60435#post-id-60435Comment by slelievre for <p><strong>Edit</strong>: I find an online Sage engine <a href="https ://sagecell .sagemath .org/">here</a> (https ://sagecell .sagemath .org/).
Also, someone asked <a href="https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/">this question</a> (https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/) a long time ago. If I can run a code for that question in this online Sage engine, then I can handle my problem. But when I write this code (that is suggested in the answer to that question) </p>
<pre><code> PSR.<q> = PowerSeriesRing( QQ, default_prec=20 )
f = qexp_eta( PSR, 20 )
f(q^{24})
</code></pre>
<p>it gives me some errors as output: </p>
<pre><code> ---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-2a3833019b43> in <module>
1 PSR = PowerSeriesRing( QQ, default_prec=Integer(20) , names=('q',)); (q,) = PSR._first_ngens(1)
----> 2 f = qexp_eta( PSR, Integer(20) )
3 f(q**{Integer(24)})
NameError: name 'qexp_eta' is not defined
</code></pre>
<blockquote>
<p>What is the problem with the code in the answer to that question? How can I write a code in that online Sage engine for the $q$-expansion of $\dfrac{\eta(z)}{\eta(4z)\eta(2z)}$? Or, for simplicity how, how can I write a code in that online Sage engine for the $q$-expansion of $\dfrac{\eta(z)}{\eta(2z)}$? </p>
</blockquote>
<hr>
<hr>
<hr>
<p>I know that my question is very simple, but I can not handle it myself. Also, I do not know whether it is a suitable question for this site or not, because I want to calculate with Magma. I read the other questions about "eta_products", for example <a href="https ://ask .sagemath .org/question/10413/coefficients-of-infinite-polynomial-products/">this question</a> (https ://ask .sagemath .org/question/10413/coefficients-of-infinite-polynomial-products/), or <a href="https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/">this question</a> (https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/) (I can't send linky texts because "my karma is insufficient to publish links", and if someone tries to edit my question, and fix the links <strong>at the end of my post</strong>, then these texts become linky automatically; also I don't know why the linky texts are referring to my question), but at the moment I do not have a system of my own on which I am allowed to install and run Sage. (The purpose of my question, is exactly the same as the question entitled "Sage function with functionality of series command from Maple.", but I am trying to do it in Magma)</p>
<hr>
<hr>
<p>I want to calculate the $n^{\text{th}}$-Fourier coefficient of some functions that are closed to $\eta$-quotients, in fact some functions that are very similar to <a href="https ://en .wikipedia .org/wiki/Euler_function">Euler function</a> $\phi(q)=\prod_{i=1}^{\infty}(1-q^{i})$, but not necessarily the same. (Notice that $\phi(q^l)=\prod_{i=1}^{\infty}(1-q^{il})$) </p>
<p>For instance, given positive integers $k, K, l, L$, with $K \mid k$ and $L \mid l$. I want to calculate the $n^{\text{th}}$-Fourier coefficient of $\dfrac{\phi(q^K)\phi(q^L)}{\phi(q^k)\phi(q^l)}$ or $\dfrac{\phi(q)\phi(q^K)\phi(q)\phi(q^L)}{\phi(q^k)\phi(q^l)}$ or some other types of
$\dfrac{\prod_{j=1}^{T}\phi(q^{L_j})^{A_j}}{\prod_{j=1}^{t}\phi(q^{l_j})^{a_j}}$ for suitable positive integers, and some other quotients that are based on some other functions that have some similarity with <a href="https ://en .wikipedia .org/wiki/Euler_function">Euler function</a>. </p>
<hr>
<hr>
<p><strong>My question</strong>: Now forget Euler function, and whatever I've said. </p>
<blockquote>
<blockquote>
<blockquote>
<p>If I know how can I calculate the $n^{\text{th}}$-Fourier coefficient of
$$\dfrac{\prod_{i=1}^{\infty}\Bigg((1-q^{iK})(1-q^{iL})\Bigg)}{\prod_{i=1}^{\infty}\Bigg((1-q^{ik})(1-q^{il})\Bigg)},$$
then I can calculate the $n^{\text{th}}$-Fourier coefficient of the others. (The product $\dfrac{\prod_{i=1}^{\infty}\Bigg((1-q^{iK})(1-q^{iL})\Bigg)}{\prod_{i=1}^{\infty}\Bigg((1-q^{ik})(1-q^{il})\Bigg)}$ does not depend on $i$, and $i$ is just a counter.)</p>
</blockquote>
</blockquote>
</blockquote>
<hr>
<hr>
<hr>
<p><strong>My attempts in Magma</strong> (My codes were not colorful, but now they are colorful; I don't know what's happened): </p>
<ul>
<li><p>I can calculate the coefficients of a polynomial: </p>
<pre><code>Coefficient(5*x^4+4*x^3+3*x^2+2*x+1, 2);
</code></pre></li>
<li><p>also, I can do some other things like: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
f := (1-x) / (1-x^2); Coefficients(f);
</code></pre></li>
<li><p>also, I can define this (but this isn't going to work): </p>
<pre><code>f := func< N, q | &*[1 - q^(i) : i in [1..N]] >;
</code></pre></li>
</ul>
<hr>
<hr>
<ul>
<li><p>This code almost works: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
N :=100; f := func< x | &*[(1 - x^(i)) : i in [1..N]] >;
F :=(f(x^2)*f(x^3))/(f(x)*f(x)); Coefficients(F);
</code></pre></li>
<li><p>but based upon the previous code, it is hard to find the $n^{\text{th}}$-coefficient, and this one is a little bit better: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
N :=30; f := func< x | &*[(1 - x^(i)) : i in [1..N]] >;
(f(x^2)*f(x^3))/(f(x)*f(x));
</code></pre></li>
</ul>
<p>But this code is not interesting either, because for example to calculate the $20^{\text{th}}$ coefficient, we need to consider $N$ large enough ($20 \leq N$), and then do the multiplication, and then search for the term $x^n$, and its coefficient. </p>
https://ask.sagemath.org/question/60429/computing-coefficients-of-certain-function-euler-function-phiq-that-is-related-to-eta-quotients/?comment=60434#post-id-60434To insert links, add spaces in them, eg https ://example .com, and someone can fix them.Sat, 25 Dec 2021 21:08:18 +0100https://ask.sagemath.org/question/60429/computing-coefficients-of-certain-function-euler-function-phiq-that-is-related-to-eta-quotients/?comment=60434#post-id-60434Comment by slelievre for <p><strong>Edit</strong>: I find an online Sage engine <a href="https ://sagecell .sagemath .org/">here</a> (https ://sagecell .sagemath .org/).
Also, someone asked <a href="https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/">this question</a> (https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/) a long time ago. If I can run a code for that question in this online Sage engine, then I can handle my problem. But when I write this code (that is suggested in the answer to that question) </p>
<pre><code> PSR.<q> = PowerSeriesRing( QQ, default_prec=20 )
f = qexp_eta( PSR, 20 )
f(q^{24})
</code></pre>
<p>it gives me some errors as output: </p>
<pre><code> ---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-2a3833019b43> in <module>
1 PSR = PowerSeriesRing( QQ, default_prec=Integer(20) , names=('q',)); (q,) = PSR._first_ngens(1)
----> 2 f = qexp_eta( PSR, Integer(20) )
3 f(q**{Integer(24)})
NameError: name 'qexp_eta' is not defined
</code></pre>
<blockquote>
<p>What is the problem with the code in the answer to that question? How can I write a code in that online Sage engine for the $q$-expansion of $\dfrac{\eta(z)}{\eta(4z)\eta(2z)}$? Or, for simplicity how, how can I write a code in that online Sage engine for the $q$-expansion of $\dfrac{\eta(z)}{\eta(2z)}$? </p>
</blockquote>
<hr>
<hr>
<hr>
<p>I know that my question is very simple, but I can not handle it myself. Also, I do not know whether it is a suitable question for this site or not, because I want to calculate with Magma. I read the other questions about "eta_products", for example <a href="https ://ask .sagemath .org/question/10413/coefficients-of-infinite-polynomial-products/">this question</a> (https ://ask .sagemath .org/question/10413/coefficients-of-infinite-polynomial-products/), or <a href="https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/">this question</a> (https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/) (I can't send linky texts because "my karma is insufficient to publish links", and if someone tries to edit my question, and fix the links <strong>at the end of my post</strong>, then these texts become linky automatically; also I don't know why the linky texts are referring to my question), but at the moment I do not have a system of my own on which I am allowed to install and run Sage. (The purpose of my question, is exactly the same as the question entitled "Sage function with functionality of series command from Maple.", but I am trying to do it in Magma)</p>
<hr>
<hr>
<p>I want to calculate the $n^{\text{th}}$-Fourier coefficient of some functions that are closed to $\eta$-quotients, in fact some functions that are very similar to <a href="https ://en .wikipedia .org/wiki/Euler_function">Euler function</a> $\phi(q)=\prod_{i=1}^{\infty}(1-q^{i})$, but not necessarily the same. (Notice that $\phi(q^l)=\prod_{i=1}^{\infty}(1-q^{il})$) </p>
<p>For instance, given positive integers $k, K, l, L$, with $K \mid k$ and $L \mid l$. I want to calculate the $n^{\text{th}}$-Fourier coefficient of $\dfrac{\phi(q^K)\phi(q^L)}{\phi(q^k)\phi(q^l)}$ or $\dfrac{\phi(q)\phi(q^K)\phi(q)\phi(q^L)}{\phi(q^k)\phi(q^l)}$ or some other types of
$\dfrac{\prod_{j=1}^{T}\phi(q^{L_j})^{A_j}}{\prod_{j=1}^{t}\phi(q^{l_j})^{a_j}}$ for suitable positive integers, and some other quotients that are based on some other functions that have some similarity with <a href="https ://en .wikipedia .org/wiki/Euler_function">Euler function</a>. </p>
<hr>
<hr>
<p><strong>My question</strong>: Now forget Euler function, and whatever I've said. </p>
<blockquote>
<blockquote>
<blockquote>
<p>If I know how can I calculate the $n^{\text{th}}$-Fourier coefficient of
$$\dfrac{\prod_{i=1}^{\infty}\Bigg((1-q^{iK})(1-q^{iL})\Bigg)}{\prod_{i=1}^{\infty}\Bigg((1-q^{ik})(1-q^{il})\Bigg)},$$
then I can calculate the $n^{\text{th}}$-Fourier coefficient of the others. (The product $\dfrac{\prod_{i=1}^{\infty}\Bigg((1-q^{iK})(1-q^{iL})\Bigg)}{\prod_{i=1}^{\infty}\Bigg((1-q^{ik})(1-q^{il})\Bigg)}$ does not depend on $i$, and $i$ is just a counter.)</p>
</blockquote>
</blockquote>
</blockquote>
<hr>
<hr>
<hr>
<p><strong>My attempts in Magma</strong> (My codes were not colorful, but now they are colorful; I don't know what's happened): </p>
<ul>
<li><p>I can calculate the coefficients of a polynomial: </p>
<pre><code>Coefficient(5*x^4+4*x^3+3*x^2+2*x+1, 2);
</code></pre></li>
<li><p>also, I can do some other things like: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
f := (1-x) / (1-x^2); Coefficients(f);
</code></pre></li>
<li><p>also, I can define this (but this isn't going to work): </p>
<pre><code>f := func< N, q | &*[1 - q^(i) : i in [1..N]] >;
</code></pre></li>
</ul>
<hr>
<hr>
<ul>
<li><p>This code almost works: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
N :=100; f := func< x | &*[(1 - x^(i)) : i in [1..N]] >;
F :=(f(x^2)*f(x^3))/(f(x)*f(x)); Coefficients(F);
</code></pre></li>
<li><p>but based upon the previous code, it is hard to find the $n^{\text{th}}$-coefficient, and this one is a little bit better: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
N :=30; f := func< x | &*[(1 - x^(i)) : i in [1..N]] >;
(f(x^2)*f(x^3))/(f(x)*f(x));
</code></pre></li>
</ul>
<p>But this code is not interesting either, because for example to calculate the $20^{\text{th}}$ coefficient, we need to consider $N$ large enough ($20 \leq N$), and then do the multiplication, and then search for the term $x^n$, and its coefficient. </p>
https://ask.sagemath.org/question/60429/computing-coefficients-of-certain-function-euler-function-phiq-that-is-related-to-eta-quotients/?comment=60433#post-id-60433Welcome to Ask Sage! Thank you for your question.Sat, 25 Dec 2021 21:07:41 +0100https://ask.sagemath.org/question/60429/computing-coefficients-of-certain-function-euler-function-phiq-that-is-related-to-eta-quotients/?comment=60433#post-id-60433Answer by FrédéricC for <p><strong>Edit</strong>: I find an online Sage engine <a href="https ://sagecell .sagemath .org/">here</a> (https ://sagecell .sagemath .org/).
Also, someone asked <a href="https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/">this question</a> (https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/) a long time ago. If I can run a code for that question in this online Sage engine, then I can handle my problem. But when I write this code (that is suggested in the answer to that question) </p>
<pre><code> PSR.<q> = PowerSeriesRing( QQ, default_prec=20 )
f = qexp_eta( PSR, 20 )
f(q^{24})
</code></pre>
<p>it gives me some errors as output: </p>
<pre><code> ---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-2a3833019b43> in <module>
1 PSR = PowerSeriesRing( QQ, default_prec=Integer(20) , names=('q',)); (q,) = PSR._first_ngens(1)
----> 2 f = qexp_eta( PSR, Integer(20) )
3 f(q**{Integer(24)})
NameError: name 'qexp_eta' is not defined
</code></pre>
<blockquote>
<p>What is the problem with the code in the answer to that question? How can I write a code in that online Sage engine for the $q$-expansion of $\dfrac{\eta(z)}{\eta(4z)\eta(2z)}$? Or, for simplicity how, how can I write a code in that online Sage engine for the $q$-expansion of $\dfrac{\eta(z)}{\eta(2z)}$? </p>
</blockquote>
<hr>
<hr>
<hr>
<p>I know that my question is very simple, but I can not handle it myself. Also, I do not know whether it is a suitable question for this site or not, because I want to calculate with Magma. I read the other questions about "eta_products", for example <a href="https ://ask .sagemath .org/question/10413/coefficients-of-infinite-polynomial-products/">this question</a> (https ://ask .sagemath .org/question/10413/coefficients-of-infinite-polynomial-products/), or <a href="https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/">this question</a> (https ://ask .sagemath. org/question/40671/sage-function-with-functionality-of-series-command-from-maple/) (I can't send linky texts because "my karma is insufficient to publish links", and if someone tries to edit my question, and fix the links <strong>at the end of my post</strong>, then these texts become linky automatically; also I don't know why the linky texts are referring to my question), but at the moment I do not have a system of my own on which I am allowed to install and run Sage. (The purpose of my question, is exactly the same as the question entitled "Sage function with functionality of series command from Maple.", but I am trying to do it in Magma)</p>
<hr>
<hr>
<p>I want to calculate the $n^{\text{th}}$-Fourier coefficient of some functions that are closed to $\eta$-quotients, in fact some functions that are very similar to <a href="https ://en .wikipedia .org/wiki/Euler_function">Euler function</a> $\phi(q)=\prod_{i=1}^{\infty}(1-q^{i})$, but not necessarily the same. (Notice that $\phi(q^l)=\prod_{i=1}^{\infty}(1-q^{il})$) </p>
<p>For instance, given positive integers $k, K, l, L$, with $K \mid k$ and $L \mid l$. I want to calculate the $n^{\text{th}}$-Fourier coefficient of $\dfrac{\phi(q^K)\phi(q^L)}{\phi(q^k)\phi(q^l)}$ or $\dfrac{\phi(q)\phi(q^K)\phi(q)\phi(q^L)}{\phi(q^k)\phi(q^l)}$ or some other types of
$\dfrac{\prod_{j=1}^{T}\phi(q^{L_j})^{A_j}}{\prod_{j=1}^{t}\phi(q^{l_j})^{a_j}}$ for suitable positive integers, and some other quotients that are based on some other functions that have some similarity with <a href="https ://en .wikipedia .org/wiki/Euler_function">Euler function</a>. </p>
<hr>
<hr>
<p><strong>My question</strong>: Now forget Euler function, and whatever I've said. </p>
<blockquote>
<blockquote>
<blockquote>
<p>If I know how can I calculate the $n^{\text{th}}$-Fourier coefficient of
$$\dfrac{\prod_{i=1}^{\infty}\Bigg((1-q^{iK})(1-q^{iL})\Bigg)}{\prod_{i=1}^{\infty}\Bigg((1-q^{ik})(1-q^{il})\Bigg)},$$
then I can calculate the $n^{\text{th}}$-Fourier coefficient of the others. (The product $\dfrac{\prod_{i=1}^{\infty}\Bigg((1-q^{iK})(1-q^{iL})\Bigg)}{\prod_{i=1}^{\infty}\Bigg((1-q^{ik})(1-q^{il})\Bigg)}$ does not depend on $i$, and $i$ is just a counter.)</p>
</blockquote>
</blockquote>
</blockquote>
<hr>
<hr>
<hr>
<p><strong>My attempts in Magma</strong> (My codes were not colorful, but now they are colorful; I don't know what's happened): </p>
<ul>
<li><p>I can calculate the coefficients of a polynomial: </p>
<pre><code>Coefficient(5*x^4+4*x^3+3*x^2+2*x+1, 2);
</code></pre></li>
<li><p>also, I can do some other things like: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
f := (1-x) / (1-x^2); Coefficients(f);
</code></pre></li>
<li><p>also, I can define this (but this isn't going to work): </p>
<pre><code>f := func< N, q | &*[1 - q^(i) : i in [1..N]] >;
</code></pre></li>
</ul>
<hr>
<hr>
<ul>
<li><p>This code almost works: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
N :=100; f := func< x | &*[(1 - x^(i)) : i in [1..N]] >;
F :=(f(x^2)*f(x^3))/(f(x)*f(x)); Coefficients(F);
</code></pre></li>
<li><p>but based upon the previous code, it is hard to find the $n^{\text{th}}$-coefficient, and this one is a little bit better: </p>
<pre><code>PQ<x> := PowerSeriesRing(RationalField());
N :=30; f := func< x | &*[(1 - x^(i)) : i in [1..N]] >;
(f(x^2)*f(x^3))/(f(x)*f(x));
</code></pre></li>
</ul>
<p>But this code is not interesting either, because for example to calculate the $20^{\text{th}}$ coefficient, we need to consider $N$ large enough ($20 \leq N$), and then do the multiplication, and then search for the term $x^n$, and its coefficient. </p>
https://ask.sagemath.org/question/60429/computing-coefficients-of-certain-function-euler-function-phiq-that-is-related-to-eta-quotients/?answer=60475#post-id-60475Use something like this:
sage: N = 20
sage: q = QQ[['q']].gen().O(N)
sage: f = prod((1-q**(2*i))/(1-q**(3*i)) for i in range(1, N+1))
sage: f
1 - q^2 + q^3 - q^4 - q^5 + 2*q^6 - q^7 - 2*q^8 + 3*q^9 - q^10 - 3*q^11 + 5*q^12 - 2*q^13 - 4*q^14 + 7*q^15 - 3*q^16 - 6*q^17 + 11*q^18 - 4*q^19 - 9*q^20 + O(q^21)
Thu, 30 Dec 2021 11:36:46 +0100https://ask.sagemath.org/question/60429/computing-coefficients-of-certain-function-euler-function-phiq-that-is-related-to-eta-quotients/?answer=60475#post-id-60475