Em Sex, 2008-11-14 às 05:06 -0800, Harald Schilly escreveu: > On Nov 14, 9:26 am, Jason Grout <[EMAIL PROTECTED]> wrote: > > > sage: sum(2^i for i in range(n+1)) > > > sum(i for i in (1..oo)) > > They look nice, but i doubt if they could work. e.g. think of more > than one variable and relationships between them (e.g. for all i,j in > N where i>j and i mod 7 == 0 and so on) Therefore, I think a new kind > of object to represent the set over which the sum is made must be > created. This set could be created by various constructors and returns > "information" about itself (not a black box). > A = sumset(vars=[i,j], start=[0,0], constraint={ i>j , mod(i,7)==0}, > intersect=sumset_B, union=sumset_C) > and then things like: values = A.getGenerator() ; A.isInfinite(i) -> > true ; j_vals_sumset = A.getSet(i=fixed_value)
No need to complicate with another object. Something like that would be nicer (if possible): sum(sum([f(j%7) for j in (0..oo) if j>k]) for k in (0..oo)])) using j and k, since i is parsed as the complex constant. Ronan Paixão --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---