Skip to content
Snippets Groups Projects
Commit bd0d4148 authored by Taddeus Kroes's avatar Taddeus Kroes
Browse files

Solved 53

parent 76268ce5
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/python
from math import ceil
prev = [1, 2]
s = 0
for n in range(2, 100):
cur = [1]
half = int(ceil(n / 2.))
for r in range(1, half + 1):
cur.append(prev[r - 1] + prev[r])
if cur[-1] > 1000000:
s += 2 if not n & 1 or r != half else 1
if not n & 1:
cur.append(cur[-1])
prev = cur
print s
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment