Today I turned 77 years of age and my equivalent diurnal age is 28124 which has the following factorisation:$$28124=2 \times 2 \times 79 \times 89$$Though this number is composite, it has numerous prime number associations. Let's examine some of them beginning with its sum of digits, sum of digits squares and sum of digits cubed:$$ \begin{align} 2 + 8 + 1 + 2 + 4 &=17 \text{ (prime)} \\2^2+8^2+1^2+2^2+8^4 &= 89 \text{ (prime)} \\2^3+8^3+1^3+2^3+8^3 &= 593 \text{ (prime)} \end{align}$$The number is only one step removed from its home prime because:$$28124=2 \times 2 \times 79 \times 89 \rightarrow 227989 \text{ (prime)}$$The number is also a member of OEIS A048381: numbers such that replacing each nonzero digit with the n-th prime (replacing each 0 digit with a 1) yields a prime. Thus:$$28124 \rightarrow 319237 \text{ (prime)}$$The number has a binary complement that is prime. The binary complement of a number is determined by changing the number to binary and swapping any 0's for 1's and vice versa. Thus:$$ \begin{align} 28124_{10} &= 110110111011100_2 \\ &\rightarrow 001001000100011_2 \\ &=4643_{10} \text{ (prime)} \end{align}$$The number is quickly captured by the prime 28109 under the ODD(+) and EVEN(-) algorithm where the sum of the odd digits is added to the number and the sum of the even digits is subtracted recursively until a fixed point is reached or a loop is entered. Here is the trajectory is simply:$$ \begin{align} 28124 &\rightarrow 28124 + 1 -(2 + 8 + 2 + 4) \\ &=28124 + 1 - 16 \\ &=28109 \text{ (prime)} \end{align}$$The number can be considered as a concatenation of powers of the prime 2 because:$$ 28124 = 2^1\, | \,2^3 \,| \,2^0 \,| \,2^1 \,| \, 2^2 $$where | represents concatenation. The number can be generated by adding the prime sum (13) of the digits of the prime 28111 to itself. Thus:$$28111+13=28124$$The digits of the number can be rearranged to form the following primes:$$22481, 24281, 24821, 42281, 42821, 48221, 82241, 82421, 84221$$The position 28124 in the Recaman Sequence is reached after a prime number of iterations:$$0 \rightarrow 28124 \text{ requires } 34183 \text{ (prime) iterations}$$
Friday, 3 April 2026
Monday, 30 March 2026
Number Testing for the Recaman Sequence
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 |
Sunday, 29 March 2026
The Mystery of 852655
After reading the report on the Recamán sequence that Gemini's Deep Research created, I was made aware of the number 852655 that everyone in the Mathematics community seemed to know about except me. At least, I now know about it and I asked Gemini to find out as much as it could about the number. The response follows but firstly let's remember that:$$852655=5 \times 31 \times 5501$$
The Enigma of 852,655
In the mathematical world, 852,655 is famously known as the smallest number that stubbornly refuses to appear in the Recamán sequence, despite mind-bogglingly massive computational efforts.
To fully understand the lore behind this specific number, it helps to break down the mechanics of the sequence, the history of the mathematical pursuit, and how it has crossed over into popular culture.
The Rules of the Sequence
Invented by Colombian mathematician Bernardo Recamán Santos and added to the On-Line Encyclopedia of Integer Sequences (OEIS) in 1991, the sequence follows a simple "subtract if you can, otherwise add" logic.
Starting at $a(0) = 0$, for each subsequent step $n$:
Try to subtract: Take the previous term and subtract the current step number $(a(n-1) - n)$.
Check the rules: If the result is greater than zero AND has not appeared in the sequence yet, you keep it.
Otherwise, add: If the result is negative, zero, or a number you have already seen, you must add instead ($a(n-1) + n$).
This creates a sequence that jumps forward and backward, constantly doubling back to fill in gaps: 0, 1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22...
The History and Fame of 852,655
Initially, Neil Sloane, the creator of the OEIS, conjectured that every positive integer would eventually appear. Because the sequence aggressively jumps backward to fill in skipped numbers, it seemed inevitable that nothing would be bypassed forever.
However, the math community eventually hit a brick wall with 852,655:
The $10^{15}$ Milestone (2001): Mathematician Allan Wilks developed a method to speed up computations and calculated the first 1,000,000,000,000,000 terms. At that point, every single number up to 852,654 had successfully appeared. But 852,655 was entirely absent.
The $10^{230}$ Milestone (2018): Benjamin Chaffin pushed the boundaries of computing and calculated the sequence up to $10^{230}$ terms. To put that magnitude in perspective, there are only about $10^{80}$ atoms in the observable universe. Even after this astronomically massive number of steps, 852,655 still had not appeared.
Today, Sloane doubts his original conjecture, and 852,655 has become the mathematical poster child for the sequence's mystery. It remains completely unknown whether 852,655 will eventually appear at some impossibly distant step, or if there is a deep, hidden structural rule preventing its appearance entirely.
Cultural Manifestations
Because of its chaotic yet highly structured nature, the Recamán sequence—and the mystery of its missing numbers—has inspired various forms of art and media:
Generative Art and Geometry: The standard way to visualize the sequence is by drawing alternating semicircles on a number line for each jump. This creates a beautiful, expanding, overlapping spiral pattern. It has become a highly popular coding exercise in generative art (using tools like Processing or D3.js) and frequently appears in posters, math-inspired tattoos, and coloring books, such as Alex Bellos and Edmund Harriss's Visions of the Universe.
Auditory Translations: The sequence's massive leaps and sudden backtrackings make it fascinating to listen to. By mapping the sequence values to musical notes, it generates an eerie, slightly unsettling melody. Neil Sloane has stated that out of the hundreds of thousands of sequences in the OEIS, Recamán's is his favorite to listen to.
Pop Math Sensibility: The sequence gained widespread internet fame through the YouTube channel Numberphile, which highlighted the auditory and visual beauty of the sequence while detailing the exact mystery of why 852,655 is such a stubborn holdout.
Would you like me to explain the algorithmic tricks mathematicians use to compute sequences up to $10^{230}$ terms without actually calculating them one by one?
This video provides a fantastic visual and auditory exploration of the sequence's jumping pattern, perfectly illustrating the chaotic beauty that leads to the mathematical mystery of numbers like 852,655.
Computing the Impossible
To understand the magnitude of mathematician Benjamin Chaffin calculating the Recamán sequence up to the $10^{230}$ term, it helps to look at physical limits. The fastest supercomputers today can perform roughly $10^{18}$ operations per second. Even if every atom in the observable universe were a supercomputer running continuously since the Big Bang, they would not even scratch the surface of $10^{230}$ operations.
Computing the sequence one step at a time is physically impossible. Instead, mathematicians use brilliant algorithmic shortcuts to "fast-forward" through the sequence and compress the massive amounts of data. Here is exactly how they accomplish this.
1. Block Skipping (Macroscopic Fast-Forwarding)
The most significant breakthrough in computing the sequence relies on a recognizable behavioral quirk: the "sawtooth" pattern.
When the sequence jumps into a high, unvisited range of numbers, it doesn't just randomly scatter. It falls into a highly predictable, alternating rhythm of addition and subtraction.
It will subtract a number, add the next, subtract the next, add the next, and so on.
This back-and-forth ping-pong effect perfectly and methodically fills in two contiguous blocks of numbers at the exact same time.
Because this behavior is mathematically predictable, an algorithm does not need to calculate every single bounce. It can simply look ahead to see where the sawtooth block will eventually collide with a boundary (a previously visited number), calculate the math for that entire chunk of bounces all at once, and skip straight to the end.
Because these predictable blocks get larger and larger as the sequence goes on, the algorithm actually speeds up exponentially.
2. Interval Compression (Run-Length Encoding)
The second massive hurdle is memory storage.
However, because the block-skipping behavior leaves behind solid, contiguous walls of visited numbers, mathematicians do not store individual integers. They store ranges.
Instead of saving the individual numbers 1, 2, 3, 4 ... all the way to 1,000,000,000, the computer simply saves the boundary interval
[1, 1000000000].As the sequence jumps around and fills in the gaps, these separate intervals begin to merge together into even larger continuous intervals.
This compression technique means that the memory required to track the sequence's history remains incredibly small, even when the sequence reaches impossibly large numbers.
3. Logarithmic Lookups
Even with compressed intervals, the computer still needs a way to instantly answer the question: "Is this new number inside one of the intervals we've already recorded?" If the computer had to read through a list of millions of intervals one by one, the computational process would grind to a halt. To solve this, the intervals are stored in highly specialized data structures, such as balanced binary search trees or custom bit-vectors. This allows the algorithm to check if a number has been visited in logarithmic time—meaning it can search through a trillion intervals in just a few dozen steps, drastically reducing the time it takes to compute the sequence's path.
By combining predictive math to skip the physical counting, and extreme data compression to avoid storing the numbers, mathematicians can peek deep into the sequence's incredibly distant future—where 852,655 is still nowhere to be found.
Would you like me to explain how the Recamán sequence has been utilized in the field of computer science for 2D image steganography (hiding secret images within other files)?
The Art of Hiding in Chaos: Recamán Steganography
Steganography is the practice of hiding a secret message or file inside an ordinary, non-secret file—such as hiding a confidential document within a standard photograph of a cat. While cryptography scrambles a message so it cannot be read, steganography hides the fact that a message exists at all.
The most common technique for image steganography is Least Significant Bit (LSB) replacement. In a digital image, every pixel's color is made of data bits. If you change only the very last bit (the least significant one) of a pixel, the color change is so microscopic that the human eye cannot detect it.
However, basic LSB steganography has a major flaw: it usually hides data sequentially, starting from the top-left pixel and moving across row by row. Cybersecurity experts can easily detect this unnatural linear footprint using statistical analysis tools.
This is where the chaotic jumping of the Recamán sequence becomes a powerful cybersecurity tool.
How the Sequence Scatters Data
To evade detection, computer scientists need to scatter the hidden data across the image in a way that looks completely random to an attacker, but is perfectly predictable to the intended recipient. The Recamán sequence provides an ideal "scatter map."
Here is how the algorithm works in practice:
1. Flattening the Canvas
A 2D image is mathematically treated as a single, massive 1D line of pixels. For example, a 1000x1000 pixel image is simply viewed as a list of 1,000,000 pixels, indexed from $0$ to $999,999$.
2. Generating the Path
The steganography software calculates the Recamán sequence. Because the sequence occasionally visits the same number twice (though rarely early on), the algorithm filters the sequence to only include unique numbers.
3. Embedding the Secret
Instead of altering pixels $0, 1, 2, 3...$ in a predictable line, the software uses the Recamán sequence to select the pixel indices.
The first bit of the secret data is hidden in pixel $0$.
The second bit is hidden in pixel $1$.
The third bit jumps to pixel $3$.
The fourth bit jumps to pixel $6$.
The fifth jumps back to pixel $2$, and so on.
4. The Security Advantage
Because the sequence jumps wildly forward and backward, the altered pixels are distributed in a highly erratic pseudo-random spread. To any steganalysis software looking for structural anomalies, these scattered altered pixels just look like natural, minor sensor noise (like the grain you see in a photograph taken in low light).
The Role of the "Key"
If the standard Recamán sequence is public knowledge, an attacker could theoretically guess the path and extract the data. To prevent this, computer scientists use Generalized Recamán Sequences.
Instead of starting at $0$ and stepping by $1$, the sequence can be mathematically tweaked. The sender might alter the starting integer, or change the addition/subtraction rules by a specific multiplier. These initial parameters act as a cryptographic key.
The Sender inputs the secret data, the cover image, and the secret mathematical parameters (the key). The algorithm generates a unique, customized Recamán path and hides the data.
The Receiver inputs the altered image and the same secret key. Their software calculates the exact same customized sequence, follows the chaotic jumps, and extracts the hidden bits.
The Attacker without the key sees nothing but an impossibly chaotic arrangement of digital noise.
By marrying the strict rule-based logic of mathematics with the visual chaos of the sequence's path, the Recamán sequence transforms from an abstract mathematical curiosity into a robust method for secure digital communication.


