4 def binomialCoefficient(n, k):
10 k = min(k, n - k) # take advantage of symmetry
13 c = c * (n - i) / (i + 1)
17 return sum([binomialCoefficient(2**(n-2)-2, 2*lp-2) for lp in range(2**(n-1))[2:]])
20 l = k if k%2 == 0 else k-1
21 print "++", 2**(n-2)-2, l-2,binomialCoefficient(2**(n-2)-2, l-2)
22 return binomialCoefficient(2**(n-2)-2, l-2)
28 sti+= str(float(bi(n))) + " & "