Ask Your Question

suit's profile - activity

2022-03-06 19:50:10 +0200 received badge  Notable Question (source)
2021-05-29 13:29:09 +0200 received badge  Popular Question (source)
2019-04-11 15:24:30 +0200 received badge  Scholar (source)
2019-04-11 15:24:25 +0200 commented answer function parameters as sum limits

Thank you for the clarification; and yes d is just a remainder from the original (more complicated) function I needed to compute. Should I remove it from the question?

2019-04-11 15:14:21 +0200 received badge  Supporter (source)
2019-04-11 01:30:52 +0200 received badge  Student (source)
2019-04-09 18:48:14 +0200 asked a question function parameters as sum limits

I am completely new to sage, so I am afraid that this should be a very standard well known issue. Sorry for that.

I need to define a function one of whose parameters is a limit of a sum. I tried:

d,n,i = var('d,n,i')
def N(d,n):
 if n==1:
        return 1
 else:
        return sum(N(d,i),i,1,n-1)

But sage complains with a RuntimeError. Why is that? I suppose that for some reason the parameter n from the function is not assigned to the variable limit n-1 in the sum. I this correct? How can I fix that?