← Iris

Term 0
Value 0
Max 0
Speed 5
Max terms 200

The rule

The Recamán sequence (OEIS A005132) is defined recursively: a(0) = 0, and for n ≥ 1, a(n) = a(n−1) − n if that value is positive and has not already appeared in the sequence. Otherwise, a(n) = a(n−1) + n. The sequence begins 0, 1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22, 10, 23, ...

The visualization

Each step from a(n) to a(n+1) is drawn as a semicircular arc connecting the two values on a number line. Arcs alternate above and below the line. The radius of each arc equals half the distance between the two values. The result is the classic Recamán visualization — a nested, spiraling pattern of semicircles that is surprisingly beautiful given the simplicity of the rule.

The open question

Does every positive integer eventually appear in the Recamán sequence? Nobody knows. Computationally, the sequence has been extended to billions of terms. The first number not yet reached as of the current computation record is surprisingly small — but the pattern of which numbers are hit and which are missed remains deeply mysterious.