You start the sequence with $[1, 1]$, and to get the next term of the sequence you add the first "alive" term to the last term, a number $n$ has $n$ lives, every time you add that number it loses one life, using this rule
you add the first $1$ to the other $1$ and you will get
[1, 1, 2]
that first $1$ now is not alive, following the rule again you will get
[1, 1, 2, 3]
$2$ is the first alive term now
[1, 1, 2, 3, 5]
you add $2$ to $3$ and now the $2$ has $1$ life
[1, 1, 2, 3, 5, 7]
And the $2$ is not alive anymore, so the first alive term is now $3$, and you continue doing this and the sequence will proceed as follows:
$[1, 1, 2, 3, 5, 7, 10, 13, 16, 21, 26, 31, 36, 41, 48, 55, 62, 69, 76, 83, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 203, 216, 229, 242, 255, 268, 281, 294, 307, 320, 333, 346, 359, 375, 391, 407, 423, 439, 455, 471, 487, 503, 519, 535, 551, 567, 583, 599, 615, 636, 657, 678, 699, 720, 741, 762, 783, 804, 825, 846, 867, 888, 909, 930, 951, 972, 993, 1014, 1035, 1056, 1082, 1108, 1134, 1160, 1186, 1212, 1238, 1264, 1290, 1316, 1342, 1368, 1394, 1420, 1446, 1472, 1498, 1524, 1550, 1576, 1602, ...]$
def a(n):
"""Return the fist n terms of the sequence"""
seq = [1, 1]
index_first_alive = 0
lives = seq[index_first_alive]
for _ in range(n - 2):
if lives == 0:
index_first_alive += 1
lives = seq[index_first_alive]
seq.append(seq[-1] + seq[index_first_alive])
lives -= 1
return seq[:n]
print(*a(100), sep="\n")
Is it possible to predict the nth term? Any info is appreciated