McLaughlin, James on Sat, 04 Jun 2011 05:36:32 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

RE: Multiple Summation Question


>Well, you can start by defining a function f that takes i, [j_1,...,j_k] and the other parameters
>and returns f_i (j_1,j_2, ..., j_i, other parameters).

>At this point you should be able to finish with forvec.

Displaying my ignorance again, but I don't see how to define such a function f in k variables j_1,j_2, ..., j_k when k is a parameter that changes.

Just to keep it simple, set j_0=0, and 
 F(k)=
Sum_{j_1=1}^1 Sum_{j_2=1}^2 ... Sum_{j_k=1}^k 
Product_{i=1}^k f_i (j_1,j_2, ..., j_i)
where
f_i (j_1,j_2, ..., j_i) = 1+ j_1*j_2*...*j_i + 2^(i*j_i - (i-1)*j_{i-1}).

I can write a program to evaluate this kind of expression for any particular k, but I still can't really see how to do it for every k.

Anyway, thanks everyone for your ideas.