What is the function of the Recamán’s Sequence?

131 viewsMathematicsOther

Tried looking at it on Wikipedia, but it’s too confusing.

In: Mathematics

Anonymous 0 Comments

It’s a little tricky to explain but pretty simple in practice.

Let’s say you want to find the nth number in the sequence. To find it, take the previous number and either subtract n or add n. The rules are, no negative numbers, and no repeating numbers that have been in the sequence already. If you can subtract without breaking the rules, you must. If you can’t subtract, you must add. The first number (or rather, the zeroth number) is always zero.

Let’s work it out. Starting at zero, how do we get the number when n = 1? 0 -1 is negative, so that’s no good, so instead we add and get 1.

0 1

Now, n = 2. 1-2 is negative, so the 2nd term is 1 + 2 = 3.

0 1 3

Now, n = 3. 3-3 is zero, which isn’t negative, but we’ve already had a zero. So the next term is 3+3 = 6.

0 1 3 6

Now, n = 4. This is the first time we’ll be able to successfully subtract, because 6-4 = 2, and we haven’t had a 2 yet.

0 1 3 6 2

And so on, and so on.