def chain(steps, value):
    for i in range(steps):
        yield value
value += sum([int(i) for i in str(value)])
x = chain(5, 409)
for i in x:
    pass
Each value in the node of a chain is calculated from the previous value plus the sum of the digits of the previous value