On Fri, Dec 14, 2012 at 2:44 PM, Santanu Sarkar <
[email protected]> wrote:

> No, as s will be a function of a,m,t,
> I need that function. For my toy example it will be easy.
>

You wrote ">     s=0" right in your question, so I don't think I'll be able
to help you further.  I hope somebody else can.


>
>
> On 14 December 2012 14:37, William Stein <[email protected]> wrote:
>
>>
>>
>> On Fri, Dec 14, 2012 at 12:31 PM, Santanu Sarkar <
>> [email protected]> wrote:
>> > Is there any function in Sage   by which  this kind of symbolic
>> calculation
>> > is possible?
>> >
>> >     s=0
>> >     for i=1 to m
>> >       if(i>a+t)
>> >         s=s+2i
>> >       else
>> >          s=s+t
>> >
>> > m,a,t are non negative integers.
>>
>> I have no idea what you're asking, but you might find this snippet of
>> Sage code relevant:
>>
>> m = 10; a = 5; t = 3
>> s = 0
>> for i in [1..m]:
>>     if i>a+t:
>>         s += 2*i
>>     else:
>>         s += t
>> print s
>>
>>
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "sage-support" group.
>> > To post to this group, send email to [email protected].
>> > To unsubscribe from this group, send email to
>> > [email protected].
>> > Visit this group at http://groups.google.com/group/sage-support?hl=en.
>> >
>> >
>>
>>
>>
>> --
>> William Stein
>> Professor of Mathematics
>> University of Washington
>> http://wstein.org
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "sage-support" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> Visit this group at http://groups.google.com/group/sage-support?hl=en.
>>
>>
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> Visit this group at http://groups.google.com/group/sage-support?hl=en.
>
>
>



-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/sage-support?hl=en.


Reply via email to