I mean to define the following recursive function
But I don't know what goes wrong in my code. May anyone more experienced with Python take a look into that? Thank you!
import scipy.special
def F(n,k):
if (k == 1):
F = 1
else:
F = 0
j = 1
while (j <= n-k+1):
a = scipy.special.binom(n,j)
b = F(n-j,k-1)
F = F + a*b
j = j + 1
return F