An interesting exercise is to determine how many iterations are required to reach a given number within the Recaman sequence. This is OEIS A057167. The initial terms that are listed in the OEIS are:
0, 1, 4, 2, 131, 129, 3, 5, 16, 14, 12, 10, 8, 6, 31, 29, 27, 25, 23, 99734, 7, 9, 11, 13, 15, 17, 64, 62, 60, 58, 56, 54, 52, 50, 48, 46, 44, 42, 40, 38, 111, 22, 20, 18, 28, 30, 32, 222, 220, 218, 216, 214, 212, 210, 208, 206, 204, 202, 200, 198, 196
Notice 99734 that I've marked in red in the terms above. This corresponds to 19 and so a remarkable 99734 iterations are required to reach this modest number. Looking further at the \(b\) table, it can be seen that 61 requires an even more impressive 181653 iterations. Interestingly 76 requires the exact same number of iterations. 133 requires only slightly fewer at 181605 and 223 fewer still at 181545. These "spikes" are relatively infrequent. The next significant one is 879 that requires 328002 iterations. However, these are mere blips compared to the staggering number of iterations required for a number like 2406 (see Table 1).
Also of interest is the maximum number reached in the trajectory leading to a given number. I got Gemini to write a SageMath program that will calculate these two statistics (permalink). Let's say we enter the number 61. Here is the output:
Target Number: 61
Iterations Required: 181653
Highest Value Attained: 881467
I've incorporated this into my daily number analysis. My diurnal age today is 28120 and entering this number, the following output is obtained:
Position in Recaman Sequence:
Target Number: 28120
Iterations Required: 34191
Highest Value Attained: 180120
I also got Gemini to create a graph based on the OEIS A057167 b-table data that lists the number of iterations for the first 20,000 numbers. The program also lists the top ten values in that range. See Figure 1.
![]() |
Figure 1: permalink |
Table 1 shows the top ten in terms of number of iterations required:
![]() |
Table 1: permalink |


No comments:
Post a Comment