Step
Term
Smallest missing
66
Options
Motion
1.0

More about Recamán's sequence

Recamán's sequence

\(a_{0}=0\). For each step n, \(a_{n}\) is \(a_{n-1}-n\) when that integer is positive and not already in the sequence. Otherwise \(a_{n}\) is \(a_{n-1}+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.

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.

Using the app

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.⁣

Frequently asked questions

What is Recamán's sequence?

The sequence with \(a_{0}=0\) and, for \(n>0\), \(a_{n}=a_{n-1}-n\) when that value is positive and new. Otherwise \(a_{n}=a_{n-1}+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.

What does Recamán's sequence sound like?

Turn on Sound, or pick the Melody favorite, and each term plays a note from an A minor scale over two octaves, chosen by its value: a soft sine tone for a backward hop and a brighter triangle tone for a forward jump. Because the terms keep hopping back and forth, the tune wanders up and down.

雷卡曼數列: how do I record a video?

Press the red Record button in the playback bar: it films what the stage shows. Press it again to stop, and the video is saved to your device.Recording is free; you only need to sign in. Without a subscription the video carries a small PictorX logo in a corner.The button beside Record opens the video options: the shape (as shown, square, story 9:16 or wide 16:9), the length (until you stop, or 5, 10, 15 or 30 seconds for social media) and the file: MP4, WebM or an animated GIF.For the sound, choose the app's own sounds or one of three music tracks: calm, bright or beat.

Ready to try it?

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

前往編輯器