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, 24 Nov 2016 02:15:21 +0100Summation with variables in limithttps://ask.sagemath.org/question/35701/summation-with-variables-in-limit/ Hi, I am new to Sage (and programming for that matter). I would like to sum (a1 +a3)(a1+a4)(a2+a3)(a2+a4) over all non-negative integers a1, a2, a3, a4 which satisfy 2*a1 + a3 + a4 less-than D and 2*a1 + a3 + a4 less-than D. Of course, my answer should be in terms of D (I have already declared D as a variable).
I have tried using the standard sum function, but that doesn't seem to work over more than one variable. I could try writing my sum as several sums, each over a single variable, but that seems tedious. Does sage allow for more complicated summations like the one I would like to calculate? If so, I would be grateful for an example.
I have tried searching for similar questions on this site, as well as google searching, but I have had no success.
Thank you.
Wed, 23 Nov 2016 16:04:08 +0100https://ask.sagemath.org/question/35701/summation-with-variables-in-limit/Comment by tmonteil for <p>Hi, I am new to Sage (and programming for that matter). I would like to sum (a1 +a3)(a1+a4)(a2+a3)(a2+a4) over all non-negative integers a1, a2, a3, a4 which satisfy 2<em>a1 + a3 + a4 less-than D and 2</em>a1 + a3 + a4 less-than D. Of course, my answer should be in terms of D (I have already declared D as a variable).</p>
<p>I have tried using the standard sum function, but that doesn't seem to work over more than one variable. I could try writing my sum as several sums, each over a single variable, but that seems tedious. Does sage allow for more complicated summations like the one I would like to calculate? If so, I would be grateful for an example.</p>
<p>I have tried searching for similar questions on this site, as well as google searching, but I have had no success.</p>
<p>Thank you.</p>
https://ask.sagemath.org/question/35701/summation-with-variables-in-limit/?comment=35710#post-id-35710"2a1 + a3 + a4 less-than D and 2a1 + a3 + a4 less-than D" is redundant, perhaps did you make a typo.Thu, 24 Nov 2016 02:15:21 +0100https://ask.sagemath.org/question/35701/summation-with-variables-in-limit/?comment=35710#post-id-35710