Example. Triangular numbers [00BQ]

tri : N -> N
tri(0) = 0
tri(n) = n + tri(n .- 1)

Instead of using :table we can also create a list to see exactly the part of the sequence we want. We can use the each function to apply tri to each index in a list.

Disco> each(tri, [0 .. 10])
[0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55]