block by Kcnarf bab49f708c556fbf3d1dd4be2f20e333

Vis. variations on Recamán sequence

Full Screen

This block displays some visual variations on the Recamán sequence. Inspiration comes from the Numberphile‘s video The Slightly Spooky Recamán Sequence.

Here is how the Recamán sequence is computed :

a(0) = 0;
for n > 0:
    a(n) = a(n-1) - n if positive and not already in the sequence,
    a(n) = a(n-1) + n otherwise

Technically speaking, this block allows me to experiment path animation with CSS.

Acknowledgments to :

index.html