Afterglowscreensavers

Recamán Arcs Screensaver

Recamán Arcs is a free, in-browser screensaver that draws Recamán’s sequence: from the last term, step back n places if that number is positive and unused, otherwise step forward n. Each step is drawn as a semicircle hopping along the number line, alternating above and below, and the nest of arcs that builds up never settles into a pattern. The line rescales as the numbers grow. Nothing to download, and ESC exits at any time.

Live preview

Recamán Arcs screensaver — Back if you can, forward if you can’t.

Press ESC to leave fullscreen. Settings are saved in your browser only.

How the Recamán Arcs screensaver works

The rule is short. Start at 0. For n = 1, 2, 3, … try to subtract n from the previous term; if the result is positive and has not appeared before, take it. Otherwise add n. The first terms run 0, 1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22, 10, 23, 9, and it is sequence A005132 in the On-Line Encyclopedia of Integer Sequences.

Each step from a to b is drawn as a semicircle with diameter |b − a|, above the line for odd n and below for even, so a backward step curls one way and a forward step the other. The arc in progress is swept out over a fraction of a second, with a bright head at the pen.

Because the forward steps grow with n while the backward steps fill in gaps, the range expands steadily but unpredictably. The number line’s scale eases toward whatever fits the largest term seen, so the picture zooms out smoothly as the sequence climbs.

After the chosen number of terms the figure is held, faded, and the sequence starts again from 0. Whether every positive integer eventually appears in the sequence is an open question.

A sequence nobody has fully tamed

The sequence was devised by Bernardo Recamán Santos, a Colombian mathematician, who wrote to Neil Sloane about it in 1991. Sloane named it Recamán’s sequence and it is entry A005132 in the On-Line Encyclopedia of Integer Sequences, which he founded. It later reached a wide audience through a Numberphile video that drew it as alternating semicircles. It is a good example of a simple deterministic rule that produces behaviour no one can fully describe.

The picture explains the pattern. Consecutive terms differ by exactly n, so the steps grow steadily. Because a number cannot be visited twice, the sequence is sometimes forced to leap forward rather than step back, producing a big arc, while backward steps can fill in gaps behind. That mix of big and small arcs gives the picture its layered, shell-like look.

Questions remain unproven. Sloane conjectured in 1991 that every positive integer eventually appears, but no proof exists, and he later said he was no longer so sure. Computations have gone astronomically far without finding it: 852,655 is still the smallest number known to be missing so far. That mix of simple rule, rich picture and open question is the sequence’s main appeal.

A worked example

At the defaults — 240 terms, Speed 4, Spectrum palette — the first arcs hop 1, 2, 3 places to the right, then a small arc curls back to 2, and within twenty terms a nest of coloured semicircles is stacked above and below the line like a Gothic vault. As the terms pass 100 and 200 the whole drawing shrinks toward the left to make room, with the newest arcs sweeping across the widening right side.

Settings & tips

Frequently asked questions

Who is Recamán?
Bernardo Recamán Santos, a Colombian mathematician who submitted the sequence to Neil Sloane in 1991. It became famous through the OEIS, through its use as a piece of music, and through this arc drawing, which appears on the OEIS home page.
Does every number appear in the sequence?
Nobody knows. It has been checked to enormous limits and some small numbers take astonishingly long to show up — 852,655 does not appear until well past the ten-billionth term — but whether all of them do is an open conjecture.
Will this slow my computer down?
It is tuned to run smoothly on an ordinary laptop. If it feels heavy, raise the Pixel size or lower the speed in the settings; every control takes effect immediately.
Is the Recamán Arcs screensaver free?
Yes. It runs free in your browser with nothing to download or install, and it keeps working offline once the page has loaded.
How do I exit the Recamán Arcs screensaver?
Press the ESC key at any time to leave fullscreen and return to the page.
Is the sequence random?
No. It is fully deterministic: the same rule always produces the same terms. The irregular look arises because the rule depends on all earlier numbers.
What is the On-Line Encyclopedia of Integer Sequences?
It is a database of integer sequences created by Neil Sloane, where each sequence has an identifying A-number. The Recamán sequence is catalogued there as A005132.

← All Generative screensavers