ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 25 Oct 2018 10:18:02 -0500How to define this polynomial?http://ask.sagemath.org/question/44061/how-to-define-this-polynomial/$ h_i(x_1,\ldots,x_n) = \sum_{j_1+\cdots+j_n=i} \;\prod_{k=1}^n x_k^{j_k}$
I think I need a Partitions(i) to do it but I need some $j_k$ to be zero, then I tried PartitionTuples(level=n,size=i), and it still doesn't work.Wed, 24 Oct 2018 15:48:34 -0500http://ask.sagemath.org/question/44061/how-to-define-this-polynomial/Comment by tmonteil for <p>$ h_i(x_1,\ldots,x_n) = \sum_{j_1+\cdots+j_n=i} \;\prod_{k=1}^n x_k^{j_k}$</p>
<p>I think I need a Partitions(i) to do it but I need some $j_k$ to be zero, then I tried PartitionTuples(level=n,size=i), and it still doesn't work.</p>
http://ask.sagemath.org/question/44061/how-to-define-this-polynomial/?comment=44062#post-id-44062Could you please provide your code ?Wed, 24 Oct 2018 15:51:12 -0500http://ask.sagemath.org/question/44061/how-to-define-this-polynomial/?comment=44062#post-id-44062Answer by FrédéricC for <p>$ h_i(x_1,\ldots,x_n) = \sum_{j_1+\cdots+j_n=i} \;\prod_{k=1}^n x_k^{j_k}$</p>
<p>I think I need a Partitions(i) to do it but I need some $j_k$ to be zero, then I tried PartitionTuples(level=n,size=i), and it still doesn't work.</p>
http://ask.sagemath.org/question/44061/how-to-define-this-polynomial/?answer=44071#post-id-44071Use something like that
sage: [v for v in IntegerVectors(n=4,k=3)]
[[4, 0, 0],
[3, 1, 0],
[3, 0, 1],
[2, 2, 0],
[2, 1, 1],
[2, 0, 2],
[1, 3, 0],
[1, 2, 1],
[1, 1, 2],
[1, 0, 3],
[0, 4, 0],
[0, 3, 1],
[0, 2, 2],
[0, 1, 3],
[0, 0, 4]]
Thu, 25 Oct 2018 10:18:02 -0500http://ask.sagemath.org/question/44061/how-to-define-this-polynomial/?answer=44071#post-id-44071