def problem53(): count = 0 # 7 is a naive lower bound on nCk, i.e. cNk(n,k) ≥ (n/k)^k applying it to n = 2m, k = m we get this lower bound for n in range(7,100+1): # we can play similiar games on how small and how large k can be, but we do not get very good bounds for k in range(4,n-3): if nCk(n,k) >= 10**6: # we account for the entire row count += n - 2*k + 1 break return count
def problem15(): return nCk(20+20,20)