DEV Community

Malcolm Low
Malcolm Low

Posted on Originally published at malcolmlow.com

The Curious Case of 1/998001: Missing Number & Math Guide

Originally published at malcolmlow.com.


Quick Answer & Key Insight: Why Does 1/998001 Generate All 3-Digit Numbers?

Yes, 1/998001 generates every 3-digit sequence. Because 998001 equals $999^2$, the decimal expansion cascades through consecutive integers, but carrying digits at the 998th block creates an unexpected loop trap that skips 998. See the mathematical proof and sequence breakdown table below →

Mathematics reveals elegant patterns in unexpected places. Consider the fraction $\frac{1}{998001}$, which equals:

0.000001002003004005006...
Enter fullscreen mode Exit fullscreen mode

Notice the pattern: it contains every three-digit integer in sequential ascending order (000, 001, 002, 003, 004, 005...).


1. The Power-of-10 Denominator Family

This phenomenon occurs because $998001 = 999^2$. Similar cascading patterns emerge in related fractions based on $10^k - 1$:

  • $\frac{1}{9} = 0.111111\dots$ (repeating 1-digit sequence)
  • $\frac{1}{99} = 0.010101\dots$ (repeating 2-digit sequence)
  • $\frac{1}{999} = 0.001001001\dots$ (repeating 3-digit sequence)

When we square the denominator, something extraordinary happens.

Consider $\frac{1}{9^2} = \frac{1}{81}$:

1 / 81 = 0.012345679012345679...
Enter fullscreen mode Exit fullscreen mode

Notice that it generates all digits from 0 to 9 in order, except the number 8 is skipped!

Similarly, $\frac{1}{99^2} = \frac{1}{9801}$:

1 / 9801 = 0.000102030405...9697990001...
Enter fullscreen mode Exit fullscreen mode

It generates all 2-digit numbers 00 to 99, except 98 is skipped!

And for $\frac{1}{999^2} = \frac{1}{998001}$, it generates all 3-digit numbers from 000 to 999, except 998 is skipped.


2. Mathematical Proof: The Series Expansion

To understand why this happens, consider the Taylor series for $\frac{1}{(1 - x)^2}$:

$$\frac{1}{(1 - x)^2} = \sum_{n=1}^{\infty} n x^{n-1} = 1 + 2x + 3x^2 + 4x^3 + 5x^4 + \dots$$

Let $x = 10^{-3} = \frac{1}{1000}$. Then:

$$1 - x = 1 - \frac{1}{1000} = \frac{999}{1000}$$

$$(1 - x)^2 = \left(\frac{999}{1000}\right)^2 = \frac{998001}{1000000}$$

Taking the reciprocal:

$$\frac{1}{(1 - x)^2} = \frac{1000000}{998001} = 1 + \frac{2}{1000} + \frac{3}{1000^2} + \frac{4}{1000^3} + \dots$$

Dividing both sides by $10^6$:

$$\frac{1}{998001} = \sum_{n=1}^{\infty} n \cdot 10^{-3(n+1)} = \frac{1}{1000^2} + \frac{2}{1000^3} + \frac{3}{1000^4} + \dots$$

Written out in decimal form:

  0.000001
+ 0.000000002
+ 0.000000000003
+ 0.000000000000004
...
= 0.000 001 002 003 004 005 ...
Enter fullscreen mode Exit fullscreen mode

3. Why is 998 Missing?

Every term adds an increment of $+1$ to its respective 3-digit block. However, what happens when $n = 998$, $999$, and $1000$?

  • For $n = 998$, the block is ... 997 [998] ...
  • For $n = 999$, the block is ... [999] ...
  • For $n = 1000$, we have four digits! The leading digit 1 cannot fit in the 3-digit slot, so it carries over into the preceding block:

$$\dots 998 + 1 \text{ (carry)} = 999$$

The cascading carry propagates backward:

  1. Block $999 + 1 = 1000$, which carries 1 into the $998$ block.
  2. The $998$ block receives the carry: $998 + 1 = 999$.
  3. The $999$ block itself becomes 000 (since its 1 was carried from the 1000 block).
  4. Thus, the sequence outputs ... 996, 997, 999, 000, 001 ...

The number 998 is absorbed by the carry from 999 and 1000!


4. Python Verification Script

You can verify this in Python using the decimal module with high precision:

from decimal import Decimal, getcontext

# Set precision to 3000 decimal places (999 * 3 digits)
getcontext().prec = 3010

fraction = Decimal(1) / Decimal(998001)
dec_str = str(fraction).split('.')[1]

# Extract 3-digit blocks
blocks = [dec_str[i:i+3] for i in range(0, len(dec_str)-10, 3)]

print(f"First 10 blocks: {blocks[:10]}")
print(f"Blocks around 998: {blocks[995:1002]}")

# Check missing number
for num in range(1000):
    expected = f"{num:03d}"
    if expected not in blocks[:1000]:
        print(f"Missing block found: {expected}")
Enter fullscreen mode Exit fullscreen mode

Output:

First 10 blocks: ['000', '001', '002', '003', '004', '005', '006', '007', '008', '009']
Blocks around 998: ['995', '996', '997', '999', '000', '001', '002']
Missing block found: 998
Enter fullscreen mode Exit fullscreen mode

Frequently Asked Questions (FAQ)

Why does 1/998001 generate all 3-digit numbers?

1/998001 equals $1/(999^2)$. Expanding $1/(10^3 - 1)^2$ produces the series $\sum n \cdot 10^{-3(n+1)}$, yielding consecutive 3-digit blocks 000, 001, 002, 003... in ascending order.

Why is 998 missing in the decimal expansion of 1/998001?

The number 998 is skipped because the addition of subsequent carried terms (specifically 999 and 1000) cascades into the 998 block, turning 998 into 999 and resetting the sequence counter.

What practical applications do these repeating fractions have?

These properties underpin cyclic decimal algorithms, pseudo-random number generation, digital filter design, and error-correcting codes where dense periodic bit sequences are required.

Top comments (0)