| Author |
Comment/Response |
Eduardo Lopez
|
05/28/12 09:14am
Hello,
I would like to create a list of all the values of the indices in the following sum:
Sum[Sum[Sum[Sum[(2 (r1-1)) (2 (r2-1)-1) (2 (r3-1)-2) (2 (r4-1)-3),{r4,r3+1,100}],{r3,r2+1,99}],{r2,r1+1,98}],{r1,2,97}]
In other words, I would like to have a flat list of all the numbers I will input into the summand (2 (r1-1)) (2 (r2-1)-1) (2 (r3-1)-2) (2 (r4-1)-3). The list would be equal to all the values the numbers {r1,r2,r3,r4} take when performing the previous sum. Thus, the list would look something like:
{{2,3,4,5},{2,3,4,6},...,{2,3,4,100},{2,3,5,6},....,{2,3,5,100},....
{97,98,99,100}}
What I'm really after is to then make this into a function lst[m_,a_] for which r1 runs from 2 to a+1, r2 runs from r1+1 to a+2, ... , and finally rm runs from r(m-1)+1 to a+m, where m and a are integers. Then, lst[m,a] would give me a list of all the combinations in the form above. The example with r1, r2, r3, r4 above corresponds to lst[4,96].
Thanks
URL: , |
|