import math import os import sys max = 365 prev = 0 i = 1 while i <= max: print(i) next = prev + i prev = i i = next