Tuesday, 31 March 2026

The Missing Elevator Numbers

I asked Gemini about the missing floor numbers in the elevator where I'm staying. See Figure 1.


Figure 1

Based on the elevator panel from Duxton Towers, the missing floor numbers are 1, 4, 11, 13, 14, 24, and 34.

In Greater Jakarta and the broader Indonesian real estate market, it is standard practice to skip certain floor numbers. The absence of these specific numbers is due to a combination of cultural superstitions, international naming conventions, and building infrastructure requirements.

Here is the breakdown of why these specific numbers are missing:

Cultural Superstitions

Property developers often combine both Eastern and Western superstitions to ensure their buildings are marketable to the widest possible demographic and to avoid alienating superstitious buyers or tenants.

  • Tetraphobia (The Number 4): There is a strong Chinese cultural influence in Indonesian real estate. In Mandarin and several other Chinese dialects, the pronunciation of the number 4 is nearly identical to the word for "death." Because of this, it is considered highly unlucky. To avoid bad fortune, developers routinely skip any floor number containing a 4. This directly accounts for the absence of floors 4, 14, 24, and 34.
  • Triskaidekaphobia (The Number 13): The aversion to the number 13 stems from Western superstition, where it is traditionally viewed as unlucky. This belief has been widely adopted in global commercial real estate, including in Indonesia. This accounts for the missing floor 13.
  • Note on Floor 14: Floor 14 is often viewed as doubly unlucky because it follows 13 and contains a 4, ensuring it is almost always removed from modern high-rise floor plans.

Naming Conventions

  • The Number 1: Indonesia generally follows the European/British floor numbering system rather than the American one. The street-level floor is designated as the Ground floor, which is why there is a "G" button at the bottom of the panel instead of a 1.

Building Operations and Infrastructure

  • The Number 11: Unlike the other missing numbers, 11 does not have a widespread cultural or superstitious stigma. Its absence from this specific passenger elevator panel is almost certainly structural or operational. In modern high-rises, certain floors are restricted from public access for a few common reasons:
    • Mechanical/Utility Floor: Floor 11 likely houses heavy building equipment, such as HVAC units, elevator machinery, electrical switchgear, or water tanks.
    • Refuge Floor: Many modern towers are required to have a dedicated, empty fire-safety evacuation floor for emergencies.
    • Zoned Access: Floor 11 might be a dedicated amenities level (like a gym, pool, or management office) that is served by a completely different set of service elevators or a separate lobby, meaning this specific public lift simply bypasses it.

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$:

  1. Try to subtract: Take the previous term and subtract the current step number $(a(n-1) - n)$.

  2. Check the rules: If the result is greater than zero AND has not appeared in the sequence yet, you keep it.

  3. 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?


The Slightly Spooky Recamán Sequence

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. It skips billions of terms in a single operation, then trillions, then quadrillions.

2. Interval Compression (Run-Length Encoding)

The second massive hurdle is memory storage. . The core rule of the sequence dictates that you must know if a number has appeared before. Storing 10^230 individual numbers would require more data storage than exists in the physical universe.

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.