def deltas():
    while True:
        yield 1
yield 3

def numbers(start, deltas, max):
    i = start
while i <= max:
    yield i
i += next(deltas)
print(','.join(str(i) for i in numbers(1, deltas(), 100)))
Generate a sequence of numbers in Python