Watch Recamán's Sequence build itself one term at a time as semicircular arcs above and below a number line. Explore the recurrence a(n) = a(n−1) − n or a(n−1) + n, zoom, pan, and count avoided collisions live.
Definition (OEIS A005132). a(0)=0; for n≥1 take a(n)=a(n−1)−n when that number is positive and has not appeared yet, otherwise a(n)=a(n−1)+n. Only the backward jump is checked, so a forward jump can land on an old value and “Unique values” (distinct terms so far) can be smaller than n+1 – e.g. 42 appears at n=20 and n=24. “Collisions avoided” counts the steps where the backward jump would have landed on an already visited number, and “Blocked by negative” the steps where it would have left the non-negative integers.
Drawing. Each step n is a semicircle on the segment between a(n−1) and a(n); arcs alternate above (even n) and below (odd n) the line. Vertical radii are squashed (above 0.85, below 0.5) for a compact picture – the horizontal extent is exact.
What is known. Since a(n) ≤ n(n+1)/2 the sequence grows at most quadratically (each step adds at most n); in practice it alternates between slow backward walks and large forward jumps. The Recamán conjecture – every non-negative integer eventually appears – is unproven (checked by computer to very large n). Watch the “Smallest value not yet seen” counter: it moves up in sudden jumps when a stubborn gap is finally filled.
Honest simplifications. The animation shows a finite prefix (up to 900 terms). The sweeping arc timing is cosmetic. The mini map draws all terms at once, upper arcs only.
Self-check (independent computation): running…