Alex's Adventures in Numberland - Alex Bellos [109]
And Sloane does have fun. He has studied so many sequences that he’s developed his own number aesthetics. One of his favourite sequences was devised by the Colombian mathematician Bernardo Recamán Santos, called the Recamán sequence:
(A5132) 0, 1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22, 10, 23, 9, 24, 8, 25, 43, 62, 42, 63, 41, 18, 42, 17, 43, 16, 44, 15, 45…
Look at the numbers and try to see a pattern. Follow them carefully. They jump around neurotically. It’s all messed up: one up here, one down there, one over there.
In fact, though, the numbers are generated using the following simple rule: ‘subtract if you can, otherwise add’. To get the nth term, we take the previous term and either add or subtract n from it. The rule is that subtraction must be used unless that results in either a negative number or in a number that is already in the sequence. Here’s how the first eight terms are calculated.
And so on.
This rather plodding process takes the integers and calculates answers that look totally haphazard. But a way to see the pattern that emerges is to plot the sequence as a graph, as shown below. The horizontal axis is the position of the terms, so the nth term is at n, and the vertical axis is the value of the terms. The graph of the first thousand terms of the Recamán sequence is probably unlike any other graph you have seen. It is like the spray of a garden sprinkler, or a child trying to join up dots. (The thick lines in the graph are clumps of dots, since the scale is so big.) ‘It is interesting to see how much order you can bring into chaos,’ Sloane remarked. ‘The Recamán sequence is right on the borderline between chaos and beautiful maths and that’s why it is so fascinating.’
The clash between order and disorder in the Recamán sequence can also be appreciated musically. The Encyclopedia has a function that allows you to listen to any sequence as musical notes. Imagine a piano keyboard with 88 keys, which comprise a spread of just under eight octaves. The number 1 makes the piano play its lowest note, the number 2 makes it play the second-lowest note, and so on all the way up to 88, which commands the highest note. When the notes run out, you start at the bottom again, so 89 is back to the first key. The natural numbers 1, 2, 3, 4, 5…sound like a rising scale set on an endless loop. The music created by the Recamán sequence, however, is chilling. It sounds like the soundtrack of a horror movie. It is dissonant, but it does not sound random. You can hear noticeable patterns, as if there is a human hand mysteriously present behind the cacophony.
The Recamán sequence.
The question that interests mathematicians about Recamán is whether the sequence contains every number. After 1025 terms of the sequence the smallest missing number is 852,655. Sloane suspects that every number will eventually appear, including 852,655, but this remains unproved. It’s not hard to understand why Sloane finds Recamán so compelling.
Another favourite of Sloane’s is Gijswijt’s sequence,* because, unlike many sequences that grow gloriously fast, Gijswijt’s increases at a mind-bogglingly dawdling pace. It’s a wonderful metaphor for never giving up:
(A90822) 1, 1, 2, 1, 1, 2, 2, 2, 3, 1, 1, 2, 1, 1, 2, 2, 2, 3, 2, 1, 1, 2…
The first time that a 3 appears is in the ninth position. A 4 appears for the first time in the 221st position. You would search until hell almost freezes over for the first time 5 rears its head,