Wednesday, 28 December 2016

Recamán Sequence

Today I turned 24381* days old and investigation of the number via the Online Encyclopaedia of Integer Sequences (OEIS) brought up reference to the Recamán Sequence that I'd never heard of. The following video does a good job of explaining its significance:



Formally, the Recamán Sequence is defined by OEIS A005132 as:
  • a(0) = 0 for n > 0   
  • a(n) = a(n-1) - n if positive and not already in the sequence,
  • a(n) = a(n-1) + n otherwise
This gives the following initial set of numbers: 
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, 14, 46, 79, 113, 78, 114, 77, 39, 78, 38, 79, 37, 80, 36, 81, 35, 82, 34, 83, 33, 84, 32, 85, 31, 86, 30, 87, 29, 88, 28, 89, 27, 90, 26, 91, 157, 224, 156, 225, 155
Where 24381 comes into play is that this number marks one of the nth positions in the Recamán sequence for which the ratio A005132(n)/n sets a new record. The OEIS sequence for these record breaking positions is A064622. The eighth member of the Recamán sequence, 20 occurring when n=7, is given as an example: A005132(7)=20, 20/7=2.857, larger than the ratio for any smaller value of n. So 7 is in the sequence.

The initial members of OEIS A064622 are:
1, 2, 3, 6, 7, 19, 34, 67, 102, 115, 190, 2066, 24381, 24398, 24399, 36130540, 409493529, 3744514071
The interesting thing is that position 24381 is closely followed by positions 24398 and 24389 (19 and 20 days respectively from today), after which there is a huge gap until the next record is set.

* as it turned out I didn't turn 24381 days old because I'd been wrongly numbering my days and so 24381 had long passed; however, apart from that the rest of the article is not affected.

No comments:

Post a Comment