def generate_chain(start, n):
    head = node = Node(start)
for _ in range(n):
    sum_of_digits = 0
v = node.get_data()
while v > 0:
    sum_of_digits += v % 10
v //= 10
node.set_next(Node(node.get_data() + sum_of_digits))
node = node.get_next()
node = head
while node:
    print(node.get_data())
node = node.get_next()
Each value in the node of a chain is calculated from the previous value plus the sum of the digits of the previous value