ExplorationsJump back if you can, forward if you cannot
Recamán’s Sequence
Start at 0 and use jump lengths 1, 2, 3 and so on. For each jump, subtract its length if the result is positive and has not appeared before; otherwise add it, even if that repeats a value. The sequenceDefinition: A sequence is an ordered list of values, usually indexed by whole numbers. begins 0, 1, 3, 6, 2, 7, and drawing an arc for each jump reveals its overlapping structure.
Current view: Arcs
The sequence drawn the way it is usually drawn - one half-circle per move.
4217back 25, somewhere new
The same data as a table
| From term | Values |
|---|---|
| 0 | 0, 1, 3, 6, 2, 7, 13, 20, 12, 21 |
| 10 | 11, 22, 10, 23, 9, 24, 8, 25, 43, 62 |
| 20 | 42, 63, 41, 18, 42, 17 |
- arc
- one move, drawn from where it started to where it landed
- back
- a move the rule was allowed to make
- forward
- a move the history forced - it could not go back
- the move just made
- where the sequence is now
Each half-circle is one move, from where it started to where it landed. Blue went back - a move the rule was allowed - and gold was forced forward. Watch how often the rule is refused. The Scale control trades label detail for reach: at the smallest size every arc is labelled with its arithmetic and its reason, at the next only the landing value survives, and beyond that the arcs stand on their own.
Move 25: back 25 to 17, which nothing had reached before.
- Now at
- 17
- Moves drawn
- 25 / 25
- Went back
- 10 of 25
Scale
In the Arcs view, the labels shrink to just the landing value - as many of them as the width can print without the numbers crowding into each other.
The rule
Go back only if the landing place is positive and new. The original rule.
Step by step
Use Step for one change you can inspect, or Run to watch the changes accumulate.
25 of 25 moves drawn.
Advanced parameters
Step n at move n. The original sequence.
25 moves.
Zero is the original.
Cases worth seeing
Try this
Find the first value the sequence reaches twice. How early does it happen?
What is going on
Each explanation begins with a worked example and follows the same operation through intuition, formal statements and proofs. Later sections distinguish what is established from questions that remain open, so you can follow the level of detail useful to you.
- 00 − 1 = −1, not positive → 0 + 11forward
- 11 − 2 = −1, not positive → 1 + 23forward
- 33 − 3 = 0, not positive → 3 + 36forward
- 66 − 4 = 2, free2back - the first time it can
- 22 − 5 = −3, not positive → 2 + 57forward
- 77 − 6 = 1, already visited → 7 + 613forward, and this is the interesting one
- 1313 − 7 = 6, already visited → 13 + 720forward
- 2020 − 8 = 12, free12back
Now draw each of those moves as a half-circle from where it started to where it landed, alternating above and below the line. Eight moves make the shape above the readout; two hundred make the picture in the laboratory.
Six of those eight moves went forward, and not one of them was a decision. Each time, the rule tried to go back and was refused - four times by the edgeDefinition: An edge is a connection between two nodes in a graph. of the number line, twice by somewhere it had already been. The picture above is made of refusals.
What you are seeing
A plain description of the process
Start at 0 and make jumps whose lengths increase by one: first 1, then 2, then 3, and so on. At move , subtract if the result is positive and has not appeared before. Otherwise add , whether or not that forward result has already appeared.
The first moves give 0 → 1 → 3 → 6. The next jump has length 4, and 6 − 4 = 2 is a new positive value, so the sequenceDefinition: A sequence is an ordered list of values, usually indexed by whole numbers. moves back to 2. At the following jump, 2 − 5 would be negative, so it moves forward to 7 instead.
Each move is drawn as a half-circle from its starting value to its destination. The arcs alternate above and below the number line so adjacent moves are easier to follow. The arc's height is a drawing convention; the rule uses only the visited whole numbers and the current jump length.
Why it starts to make sense
Intuition, before any algebra
Two ingredients, and it is worth separating them because only one is doing the interesting work.
The step grows. At move 100 the sequenceDefinition: A sequence is an ordered list of values, usually indexed by whole numbers. jumps by 100. It can never settle into a rhythm, because the rhythm changes every time.
The rule has a memory. "Not already visited" means every future move depends on the entire history. This is unusual: most rules in this guide are maps, where the next value depends only on the current one. Kaprekar's routine does not care how you arrived at 3524. Recamán's rule cares about everything.
That distinction is testable rather than rhetorical, and this page tests it. Switch the rule to Forget - go back whenever the landing place is positive, visited or not - and the arithmetic is untouched while the picture collapses into a zigzag over a small range.
So: not the arithmetic. The memory.
The key idea
Every forward move is a refusal
Look again at what a forward move means.
The rule always prefers to go back. It goes forward only when it is blocked - either because going back would leave the non-negative integersDefinition: An integer is a whole-number value, including zero and negative whole numbers, with no fractional part., or because going back would repeat a value. So the sequenceDefinition: A sequence is an ordered list of values, usually indexed by whole numbers. of directions is not a pattern the rule generates. It is a record of when the history got in the way.
This has an immediate consequence, and it is the one that makes the drawing worth looking at:
A backward move can never land on a value the sequenceDefinition: A sequence is an ordered list of values, usually indexed by whole numbers. has already reached. Every repeated value is therefore a forward move arriving somewhere it had been before.
Repeats exist - 42 is reached at move 20 and again at move 24 - and every one of them is a collision the rule could not avoid rather than one it chose.
Formal statement
Precisely what is being claimed
Define and, for ,
Then:
- Every is a non-negative integerDefinition: An integer is a whole-number value, including zero and negative whole numbers, with no fractional part., and . (From a start other than 0, as the laboratory allows, the bound is - what is really bounded is the displacement from the start.)
- The map is not injectiveDefinition: A function is injective when different inputs always produce different outputs..
- Whether - whether every non-negative integerDefinition: An integer is a whole-number value, including zero and negative whole numbers, with no fractional part. appears - is open.
Statement 3 is the one people care about, and it is the one nobody can answer.
Proof
Of the parts that admit one
Non-negativity and the bound. Each move changes the value by exactly , so all terms are integersDefinition: An integer is a whole-number value, including zero and negative whole numbers, with no fractional part.. A backward move is taken only when the result is positive, and a forward move only increases the value, so no term is ever negative. After moves the total distance travelled is at most , and the sequenceDefinition: A sequence is an ordered list of values, usually indexed by whole numbers. starts at 0, so cannot exceed that. ∎
Non-injectivity. By exhibiting a repeat: . A single example settles an existence claim completely, which is the one situation where computation and proofDefinition: A proof is a finite argument showing that a conclusion follows from stated assumptions. coincide. ∎
Appearance. No proofDefinition: A proof is a finite argument showing that a conclusion follows from stated assumptions. is known, in either direction. Note what is not available here: the argument that saves the happy numbers page - the map cannot outrun itself, so the space closes and enumeration finishes - has no analogue. This sequenceDefinition: A sequence is an ordered list of values, usually indexed by whole numbers. is unbounded, so there is no finite region to enumerate and no amount of computing that could finish the job.
Limits and frontier
Where this page stops being able to help
The gaps you can see are not evidence. With the original rule and a few hundred terms, the smallest number never reached is 19. It is very tempting to treat a persistent gap as a discovery. It is not: the sequenceDefinition: A sequence is an ordered list of values, usually indexed by whole numbers. is unbounded and keeps returning to small values, so a number absent after 1,200 moves may well arrive after a million. The literature reports the first seriously missing candidate as a six-figure number, far beyond anything this page computes.
Some gaps are structural rather than accidental. Switch the step sizes to the odd numbers. Every step now changes the parityDefinition: Parity records whether an integer is even or odd., so the terms alternate from wherever they began: , which for the original start of 0 reads . No value is ruled out of the sequenceDefinition: A sequence is an ordered list of values, usually indexed by whole numbers. altogether - both parities still turn up - but each one can now only be reached on moves of its own parity, which is a constraint the original rule does not have. That is worth having next to the previous paragraph, because a limitation you can prove and a gap left by a short run look identical in the picture.
The picture is a choice. The arcs, their radiiDefinition: A radius is a straight segment from the centre of a circle to its rim, or the length of that segment., and which side of the line they fall on are drawing decisions, not facts about the sequenceDefinition: A sequence is an ordered list of values, usually indexed by whole numbers.. Plot the same integersDefinition: An integer is a whole-number value, including zero and negative whole numbers, with no fractional part. as an ordinary line graphDefinition: A graph is a collection of nodes joined by edges that record relationships or transitions. and most of the magic evaporates. This is not a debunking - the arc drawing genuinely reveals the alternation between forced and free moves - but a visualisation is an argument, and an argument should be labelled as one.
What this page cannot do. It draws at most 1,200 moves. The open question is about all of them.
What is actually established
Every statement on this page, with its status, its exact scope, and the date that status was last checked.
The sequence is well defined, every term is a non-negative integer, and the nth term is at most a₀ + n(n+1)/2.
- Scope
- The original rule with step n, from any non-negative start a₀. For the original start of 0 the bound reads n(n+1)/2.
- Why
- Each move either adds or subtracts n, so the terms are integers; a backward move is taken only when the result is positive, so no term is negative. The bound is on the *displacement* from the start: the total distance travelled after n moves is at most 1 + 2 + … + n, so the term itself can be that much above wherever the sequence began.
- Status checked
Whether every non-negative integer eventually appears in Recamán’s sequence is unresolved.
- Scope
- The original sequence, over all of its infinitely many terms.
- Why
- This is the question the “what is reached” view is about. Large computations have pushed the search a very long way without settling it, and a search - however long - cannot settle it. What such a search establishes is that no counterexample lies below the point it reached.
- Status checked
The sequence is not injective: 42 is reached at move 20 and again at move 24.
- Scope
- The first 1,200 terms of the original sequence, recomputed here.
- Why
- A backward move can never land on a visited value - the rule forbids it - so every repeat is a forward move arriving somewhere the sequence had already been. Repeats are common rather than exceptional.
- Computation (exact)
- Exact integer arithmetic over the terms drawn, up to 1,200 moves, computed in your browser and checked against an independent implementation in the test suite. Algorithm recaman-1.
- Status checked
- Sources
- A005132 - Recamán’s sequence
In the first 1,200 terms the smallest non-negative integer never reached is 19.
- Scope
- This run only: 1,200 terms of the original sequence, starting from 0. Produced by this page.
- Why
- Deliberately recorded as an observation. It is tempting to read a persistent gap as evidence that a number never appears, and it is nothing of the kind - the sequence is unbounded and keeps returning to small values. The literature reports the first genuinely missing candidate as far larger, and this page cannot reach it.
- Computation (exact)
- The smallest missing value is searched only up to the largest value the run reached; beyond that everything is trivially absent, and reporting the search limit as a discovery would be misleading. Nothing here is evidence about later terms. Algorithm recaman-1.
- Status checked
- Sources
- A005132 - Recamán’s sequence
Removing the “not already visited” condition, and changing nothing else, produces a markedly simpler sequence: with the original step sizes over 300 moves it reaches 186 distinct values against 262, and a maximum of 454 against 1,096.
- Scope
- The two rules with step n from 0, at the term counts offered here. Not a general ordering: with prime step sizes over 300 moves, forgetting reaches a *larger* maximum than remembering, even though it still reaches fewer distinct values.
- Why
- The clearest statement on the page of where the complexity lives. Both rules do the same arithmetic; only one consults the history. The comparison view runs them side by side, and the figures under each panel are recomputed for whatever parameters are selected rather than quoted from here.
- Computation (exact)
- Both sequences computed in full with exact integer arithmetic for the selected term count. A comparison at the sizes offered here, not an asymptotic statement about either rule. Algorithm recaman-1.
- Status checked
The arcs alternate above and below the line by move index. That alternation is a drawing convention, not a property of the sequence.
- Scope
- The figure on this page.
- Why
- Stated because the picture is doing persuasive work. The sequence is a list of integers; the arcs, their radii and which side they fall on are choices made when drawing it. The Moves table is the same information without any of those choices.
- Status checked
Sources
Review notes show which bibliographic details Mathomaly has checked and which remain unresolved. Checking a publication record does not independently verify its proof.
- A005132 - Recamán’s sequence, The On-Line Encyclopedia of Integer Sequences. Link
The sequence, its history, and the record of how far the appearance question has been pushed. The specific search bounds quoted on this page come from here and have not been independently reproduced.
Bibliographic record checked. This is not an independent verification of the proof.
Bibliographic review:
AI-assisted bibliographic audit. Evidence type: source text.
Checked the sequence identifier, definition and displayed initial terms on the database entry.
Where most people meet the sequence, and the source of the arc drawing convention used here.
Bibliographic record checked. This is not an independent verification of the proof.
Bibliographic review:
AI-assisted bibliographic audit. Evidence type: source text.
Creator's page confirms the video title and Sloane presentation.
Standard reference; the question of whether every non-negative integer appears is listed among the elementary open problems.
Bibliographic record checked. This is not an independent verification of the proof.
Bibliographic review:
AI-assisted bibliographic audit. Evidence type: publisher record.
Publisher confirms the author, third edition and 2004 print publication. This check does not verify every section attribution.
Related by mechanism
Connected by how they work, not by sharing a topic label.