Home▸Articles▸Drawing with Maths

Recamán's Sequence: A Visual Dance of Numbers

A fascinating mathematical sequence that creates intricate patterns when visualized as arcs above and below a number line.

mysimulator teamUpdated June 2026≈ 3 min read▶ Open the simulation

What is Recamán's Sequence?

Recamán’s sequence is defined as a(n) = a(n-1) - n if the result is positive and not already in the sequence, otherwise a(n) = a(n-1) + n. The sequence starts with 0: 0, 1, 3, 6, 2, 7, 13, 24, ... Each term alternates between subtracting and adding the index to the previous term.

This sequence is not only mathematically intriguing but also visually captivating when represented as arcs above and below a number line.

Visualizing Recamán's Sequence

The visualization of Recamán’s sequence as rainbow semicircular arcs provides a dynamic way to understand the pattern. Each arc represents a step in the sequence, with positive steps above the number line and negative steps below.

The arcs not only illustrate the mathematical operations but also reveal underlying patterns and symmetries within the sequence.

live demo · related simulation● LIVE

Counting Collisions

Live collision counting in the visualization helps to understand how often a new term would have been placed at an already occupied position. This provides insight into the distribution of numbers in the sequence and their uniqueness.

By analyzing collisions, one can gain deeper insights into the structure and behavior of Recamán’s sequence.

Navigating Through Terms

The recurrence panel allows for detailed exploration of individual terms in the sequence. By stepping through the term table, users can observe how each new term is calculated based on the previous one.

The mini map provides a comprehensive overview of the entire sequence, making it easier to follow long-term patterns and trends.

Frequently asked questions

What makes Recamán's sequence unique?

Recamán’s sequence is unique because its terms are generated by alternating between subtraction and addition based on the previous term, leading to a non-monotonic pattern that can be unpredictable.

How does collision counting work in the visualization?

Collision counting tracks how many times a new term would have been placed at an already occupied position. This helps in understanding the distribution of numbers and their uniqueness within the sequence.

Can Recamán's sequence be used for practical applications?

While primarily a mathematical curiosity, Recamán’s sequence has potential uses in areas like algorithm design and random number generation due to its unique properties.

Is the visualization accurate for all terms of the sequence?

The visualization accurately represents each term according to the rules of Recamán’s sequence, providing a faithful representation of how the sequence evolves over time.

Try it live

Everything above runs in your browser — open Recamán's Sequence Neon Arc Visualiser: Live Collision Counter, Recurrence Panel and Mini Map and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open Recamán's Sequence Neon Arc Visualiser: Live Collision Counter, Recurrence Panel and Mini Map simulation

What did you find?

Add reproduction steps (optional)