Multiple sums.
- To: mathgroup at smc.vnet.net
- Subject: [mg5759] Multiple sums.
- From: Gadi Oron <oron at tremois.pmmh.espci.fr>
- Date: Tue, 14 Jan 1997 10:42:32 -0500
- Organization: Acces regional Ile-de-France (Univ. Paris VI/VII) - France
- Sender: owner-wri-mathgroup at wolfram.com
Hi there,
I would like to thank all of those who had replied to my previeous
questions, that was very helpful.
So now for a new one :
I want to do a multiple sum with a variable number of variables (hehe)
something of this type :
Sum[f1(n[1],..,n[M])*Sum[f2(n[1],..,n[M])* ..., {n[1],1,g1(n[1],...)},...]
so I wrote; (Well, i've copied it directly so the functions f and g are
already there)
sl[L_,n_]:=Module[{r=1-n/L,t,l},
t=(L r+1-Sum[l[p],{p,1,n-1}]);
For[ii=n-1,ii>0,ii--,
t=Sum[(1+l[ii])*t,{l[ii],0,L r-Sum[l[k],{k,1,ii-1}]}];
];
Return[t];
]
Well, it is quite unreadeble but whats essential is that the ii in the range
index won't evaluate, so the sums are made with (litterally) l[ii] and
not with l[1],l[2] etc,
I even tried to evaluate the ranges before, putting
a={l[ii],0,L r-Sum[l[k],{k,1,ii-1}]}
t=Sum[... ,a]
But then MM yells that the range is incorrect.
Any ideas?
P.S. : Excuse me for being unclear about this one.
See ya.
/\/\/\/\/\/\/\/\/\/\/\/>> Gadi ORON <<\/\/\/\/\/\/\/\/\/\/\/\/\
| EMAIL : oron at pmmh.espci.fr :::: oron at clipper.ens.fr |
| Homepage : http://pmmh.espci.fr/home/oron/WWW/personal.html |
| fido : 2:325/302.8 |
| Soyez braves - be brave. |
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/