Recamán sequence
The Recamán sequence starts at zero. At each step n, try to subtract n from the current value. If the result is positive and hasn’t appeared yet, take it. Otherwise, add n instead. The rule is trivial. The behavior is not. Visualized as semicircular arcs alternating above and below a number line, the sequence draws itself into an unexpectedly beautiful pattern — and nobody knows whether every positive integer eventually appears.
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.