66
1.0

More information about Recamán's sequence

Recamán's sequence

a₀ = 0. For each step n, aₙ is aₙ₋₁ − n when that integer is positive and not already in the sequence. Otherwise aₙ is aₙ₋₁ + n. The first terms are 0, 1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22, 10, 23, 9, 24. PictorX draws each hop as a semicircle, lists the reason for the choice, and marks the smallest positive integer the prefix has not reached. Semicircles alternate above and below the number line. Drag to move, scroll to zoom, and double-click to fit. Turn on Sound to hear each hop.

How it works

  1. Open this page and watch the semicircles grow above and below the number line.
  2. Switch to Steps to read why each term was chosen, or to Missing numbers to see the smallest gap.
  3. Turn on Sound, then save a PNG or continue in the PictorX editor.

Backward when the spot is free

The sequence starts at 0. Step n subtracts n when the result is a positive integer that has not appeared yet. If that spot is negative or already used, the step adds n instead. Zero is the starting term, so a hop back onto 0 is refused. The first fifteen terms are 0, 1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22, 10, 23, 9, 24.

Semicircles, then the gaps

A semicircle of diameter n joins each term to the next. Odd steps arch above the line and even steps arch below. Teal means the step hopped backward into a free integer. Amber means it had to jump forward. After the first fifteen terms, 4 is still missing. It appears at step 131. Missing numbers names the smallest gap in whatever prefix you draw.

A conjecture, still open

Neil Sloane conjectured that every nonnegative integer eventually appears. The conjecture is unproved. Benjamin Chaffin reported in February 2026 that after 10^612 terms, 852,655 is still the smallest missing number. The drawing, the step table, and the melody all run in your browser.

Frequently asked questions

What is Recamán's sequence?

The sequence with a₀ = 0 and, for n > 0, aₙ = aₙ₋₁ − n when that value is positive and new. Otherwise aₙ = aₙ₋₁ + n. It begins 0, 1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22, 10, 23, 9, 24.

Why does step 7 land on 20?

13 − 7 = 6, and 6 is already in the sequence, so the backward hop is refused. The step adds 7 and lands on 20.

What do the semicircles show?

Each arc connects one term to the next and has diameter n. Odd steps go above the number line and even steps go below. Teal arcs hopped backward. Amber arcs jumped forward.

Does every number appear?

It is an open conjecture, due to Neil Sloane, that every nonnegative integer appears. After 10^612 terms, 852,655 is still the smallest missing number.

Does the math run in my browser?

Yes. The sequence, the arcs, the gaps, and the melody are computed on your device. Save a PNG or open the canvas in the PictorX editor.

Ready to try it?

Open PictorX in your browser — no install, no credit card required to start.

Go to Editor