14 lines
210 B
Python
14 lines
210 B
Python
|
|
def calc(limit):
|
|
a, b = 3, 5
|
|
n = 2
|
|
d = 1
|
|
for i in range(limit):
|
|
yield n
|
|
n += d * a
|
|
a, b = b, a + b
|
|
a, b = b, a + b
|
|
d = 3 - d
|
|
|
|
print(sum(list(calc(30))))
|