loading...
running...
How to use
Press a preset or choose the number of terms and the speed. Arcs are added one at a time: back-steps above the line, forward-steps below. The white dot is the current term. Drag to orbit, wheel or pinch to zoom; the camera buttons fly to Front, Angle, High, Walk (along the deck) and Under views, and the camera follows the growing bridge until you orbit yourself. Try the step rules, the start value and the colour modes, and tick Sound to hear the walk. Space pauses, R resets.
Models and baked PBR textures made in Blender; Three.js r160 animates every part from the shared maths module.
The science
Definition. Recamán's sequence (OEIS A005132) starts at a(0) = 0. For n ≥ 1:
a(n) = a(n-1) - n if that value is ≥ 0 and has not appeared before; otherwise a(n) = a(n-1) + n
Each step is drawn as a semicircle whose diameter is the segment between a(n-1) and a(n), so its radius is n/2 and its length is πn/2. In this page a backward step is drawn above the line and a forward step below it (or alternating, if you choose that); the picture is the same either way.
Parity law. Because ±n has the same parity as n, a(n) ≡ 1 + 2 + ... + n = n(n+1)/2 (mod 2). It follows that a(n) ≤ n(n+1)/2, with equality only while every step has gone forward, as in the first steps for a(0) = 0 where 0, 1, 3, 6 are the triangular numbers.
Collisions avoided. The counter in the readout is the number of steps in which the backward move was refused (negative or already visited) and the walk was forced forward. Those forced moves are what push the walk outwards: the running maximum grows roughly linearly, about 3 to 4 times n for the first 20000 steps in this page (see the ratio graph), far below the n(n+1)/2 bound.
Open question. It is conjectured, but not proved, that every non-negative integer eventually appears. Computation shows the smallest integer still missing after 20000 steps is 19 (the readout shows it for the current n) and that only about 56% of the integers up to n have been visited after n steps; coverage of the full range is slow and uneven, which is the structure the density graph shows.
Variants. The step rule menu changes the step length s(n): 2n - 1 (odd), 2n (even) or the n-th prime. The same "go back if allowed, otherwise forward" rule is applied, and the start value a(0) can be raised. These are exploratory generalisations: they are not the OEIS sequence, and the parity and bound statements above apply only to the classic rule.
Simplifications. Up to 20000 terms are computed exactly in 64-bit floating point (all values are integers well below 2^53); the drawing is a straightforward geometric picture, with line width and colour purely cosmetic. The sound option maps the value to a pentatonic pitch and is only a sonification, not part of the mathematics.
In the 3D sculpture. Every arc is a real arch: a half annulus of radius n/2 spanning a(n-1) to a(n), built once in Blender and drawn as one GPU instance per term (up to 2400). Back-steps arch above the deck and forward-steps hang below it. The deck is the number line, brass studs mark visited integers, and the posts and plaques are milestones at round values. The whole sculpture is rescaled continuously so it always fits; the readout shows the current metres per unit.