[ create a new paste ] login | about

Link: http://codepad.org/DFbRlC4U    [ raw code | output | fork ]

Python, pasted on Nov 26:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
a = []
a.append(2)
for i in range(1, 34):
    a.append(1)
    a.append(2 * i)
    a.append(1)

n = 100
numerator = 1
denominator = a[n - 1]
n -= 1
for i in reversed(a[:n]):
    tmp = denominator
    denominator = denominator * i + numerator
    numerator = tmp

print(sum(map(int, str(denominator))))


Output:
1
272


Create a new paste based on this one


Comments: