Ask Your Question

Quotenbanane's profile - activity

2018-12-22 19:19:40 -0500 received badge  Scholar (source)
2018-12-22 19:19:39 -0500 received badge  Supporter (source)
2018-12-22 19:19:35 -0500 commented answer Defined variable in recursive function

Thanks a lot sir :) And say hello to the recursive function of the Bernoulli-numbers.

2018-12-22 19:15:21 -0500 received badge  Student (source)
2018-12-22 19:09:37 -0500 asked a question variable in recursive function
@cached_function
def Folge2(n):
    k = var('k')
    if n < 1:
        return 1
    else:
        return (-1/(n+1)*sum((binomial(n+1,k)*Folge2(k)),k,0,n-1))

print Folge2(1)

Hello. I've got a problem with this program right here.

Sage is giving back a "RuntimeError: maximum recursion depth exceeded while calling a Python object". It is likely because i'm calling Folge2(k) again with k as defined variable.

How can i avoid this?

Best regards.

2018-12-22 19:09:37 -0500 asked a question Defined variable in recursive function
@cached_function
def Folge2(n):
    k = var('k')
    if n < 1:
        return 1
    else:
        return (-1/(n+1)*sum((binomial(n+1,k)*Folge2(k)),k,0,n-1))

print Folge2(1)

Hello. I've got a problem with this program right here.

Sage is giving back a "RuntimeError: maximum recursion depth exceeded while calling a Python object". It is likely because i'm calling Folge2(k) again with k as defined variable.

How can i avoid this?

Best regards.

2018-12-22 19:09:37 -0500 asked a question Variable declaration in recursiv function
@cached_function
def Folge2(n):
    k = var('k')
    if n < 1:
        return 1
    else:
        return (-1/(n+1)*sum((binomial(n+1,k)*Folge2(k)),k,0,n-1))

print Folge2(1)

Hello. I've got a problem with this program right here.

Sage is giving back a "RuntimeError: maximum recursion depth exceeded while calling a Python object". It is likely because i'm calling Folge2(k) again with k as defined variable.

How can i avoid this?

Best regards.