Ask Your Question

Quotenbanane's profile - activity

2020-12-01 12:02:29 +0200 received badge  Popular Question (source)
2018-12-23 02:19:40 +0200 received badge  Scholar (source)
2018-12-23 02:19:39 +0200 received badge  Supporter (source)
2018-12-23 02:19:35 +0200 commented answer Defined variable in recursive function

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

2018-12-23 02:15:21 +0200 received badge  Student (source)
2018-12-23 02:09:37 +0200 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-23 02:09:37 +0200 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-23 02:09:37 +0200 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.