沒有人會為弱者流眼淚
#!/usr/bin/python c = [1, 1, 1] for _ in range (3, 10+1): # f(n+1) = f(n) * (4n-6 / n) c.append(c[_-1] * (4*(_-1) - 6) / (_-1)) print c[2:] # [1, 1, 2, 5, 14, 42, 132, 429, 1430]
No comments:
Post a Comment