%

Algorithmic counting

This patch demonstrates an application of modular arithmetic to wrap a series of numbers around within a defined range. The algorithm produces a series of expanding steps: 0, 1, 3, 6, 10, 15, 21, etc. The difference between each number and its predecessor in the series increases with each step—1-0=1, then 3-1=2, 6-3=3, 10-6=4, and so on. We do this by incrementing a counter and adding its output to the previous output of the + object.