The Recaman sequence

Mathematics has different areas, one of them is the number theory, which includes the mathematical sequences and series, which have peculiar characteristics and a unique aesthetic. An particularly interesting case is the Recamán sequence.

Mathematical sequences are numerical series that follow a particular arrangement of rules, many of these sequences are just mathematical exercises, but there are some that are recurrent in aspects of nature, such as the case of the Fibonacci sequence, which is common to find it in certain patterns in flowers, the distribution of tree branches or the arrangements of leaves in certain plants and even in the proportion of the length of the phalanges of our hands. In all these cases the relationship with the Fibonacci sequence is evident.

But there are other sequences that are considered only curiosities or mathematical exercises, such as the figurative series; an example is the quadratic numbers which is the sequence of numbers that form square matrices: 1,4, 9, 16, 25, 36, … etc. As you are, you can form triangular, pentagonal and hexagonal series.

Polygonal numbers

Polygonal numbers (

These series may seem only simple mathematical exercises, but in reality, there are mathematical series that are of great importance and of daily use in the areas of physics and engineering. But it is certainly undeniable that many of them are only created by the delight of experimenting with these interesting mathematical exercises.

One of these examples is that of the central polygonal numbers; problem that has as a rule to determine the maximum number of pieces resulting from applying linear cuts to a circle; in this case if we start from scratch, the maximum number of pieces is 1, 2, 4, 7, 16,…; which as a formula can be expressed as:

P= (n^2 +n +2)/2




The sequence of Recamán is another series that derive from a mathematical exercise, but it is undeniable that its result is extremely interesting.

This sequence was created by Bernardo Recamán Santos, Colombian mathematician; although it wasn’t him who named her as such; This name was given by Neil James Alexander Sloane, a professor at Cornell University, who properly named it like this in his “Encyclopedia of integer sequences”, referring to its author.

The Recamán series, like other series, follows specific rules to be generated, which could be defined in a sentence as the rule of “subtract if possible, and if not add”. To explain this, the formal definition is as follows:

– Start with a list of numbers, with zero value as the origin.
– Jumps are made in the sequence of the size of the sum of the natural numbers, 1, 2, 3, etc.
– First, you try to move the sequence backwards (towards smaller numbers).
– Only if the number is greater than zero and has not been previously selected, you can go backwards, otherwise the sequence moves forward.

Its formula is:
– a0 = 0
– an = an-1 – n   if it’s positive & it’s not on the list.
– an = an-1 + n  in any other case.

To see this exercise graphically, we can review how the Recamán sequence is generated for the first 7 natural numbers.

Recaman (

1: You cannot go backwards (we are at the origin), then move the sequence one position forward. (position: 1)
2: You cannot go backwards (You cannot go back two), then move the sequence two positions forward. (position: 3)
3: You cannot go backwards (the origin is already “occupied”), then move the sequence three positions forward. (position: 6)
4: The sequence moves four positions backwards (position two has not been used yet), (position: 2)
5: You cannot go backwards (you cannot go back five positions), then move the sequence five positions forward. (position: 7)
6: You cannot go backwards (you cannot go back six positions because position one has already been used), then move the sequence six positions forward. (position: 13).
7: You cannot go backwards (you cannot go back seven positions because position one has already been used), then move the sequence seven positions forward. (position: 20).

Following this series of rules, the sequence obtained is as follows:

– 0, 1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22, 10, 23, 9, 24, 8, …

The numerical sequence by itself is not entirely interesting, but if these values are represented graphically, you can notice a harmonious and aesthetic pattern. By using a repetition of semicircles, you can notice that they seem to be concentric, but in reality they are a single continuous trajectory.

Graphical Recaman series

Graphical Recaman series (

This and many other numerical sequences (such as Fibonacci), can be reviewed at, the on-line encyclopedia of numerical sequences (by its acronym in English). In this site, you can find for each sequence, the definition of its rules and methods to be able to calculate them, represent them graphically and even musically emulate these sequences. As an example, the Recamán sequence can be obtained in this link. And as with its graphic representation, and with certain musical adjustments to adapt scales; its musical representation is equally interesting, given its organic modulation.

I hope you enjoy, as I do, these representations of the Recamán sequence.

Regards, Alex – ScienceKindle!

Subscribe to ScienceKindle!
I agree to have my personal information transfered to MailChimp ( more information )
Join my newsletter and be part of the community receiving the latest articles and news about my site.
We hate spam. Your email address will not be sold or shared with anyone else.
Please follow and like us:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.