Playing with numbers: 1/998001 and others

A post in response to Colin’s “Patterns in numbers”:

1/998001 = 0.000 001 002 003 004 005 006 007…

goes through all integers 000 through 999, skipping only 998. Maple confirms this:


This fraction made rounds on the internet a while ago.

I begin with two general claims:

  • Integer numbers are more complicated than polynomials
  • Decimal fractions are more complicated than power series

To illustrate the first one: multiplying 748 by 367 takes more effort than multiplying the corresponding polynomials,

(7x^2+4x+8)(3x^2+6x+7) = 21x^4+54x^3+97x^2+76x+56

The reason is that there’s no way for the product of 4 x and 3x^2 to “roll over” into x^4. It’s going to stay in the x^3 group. Mathematically speaking, polynomials form a graded ring and integers don’t. At the same time, one can recover the integers from polynomials by setting x=10 in 21x^4+54x^3+97x^2+76x+56. The result is 274516.

Moving on to the second claim, consider the power series

\displaystyle (*) \qquad \frac{1}{1-t}=1+t+t^2+t^3+\dots = \sum_{n=0}^{\infty} t^n

I prefer to use t instead of x here, because we often want to replace t with an expression in x. For example, setting t=2x gives us

\displaystyle \frac{1}{1-2x}=1+2x+4x^2+8x^3+\dots = \sum_{n=0}^{\infty} 2^n x^n

which is nothing surprising. But if we now set x=0.001 (and, for neatness, divide both sides by 1000), the result is

\displaystyle \frac{1}{998}=0.001\ 002\ 004\ 008\ 016\ 032 \dots

which looks like a magical fraction producing powers of 2. But in reality, setting x=0.001 did nothing but mess things up. Now we have a complicated decimal number, in which powers of 2 break down starting with “513” because of the extra digits rolled over from 1024. In contrast, the neat power series keeps generating powers of 2 forever.

By the way, \displaystyle \frac{1}{1-2x} is the generating function for the numbers 1,2,4,8,16…, i.e., the powers of 2.

So, if you want to cook up a ‘magical’ fraction, all you need to do is find the generating function for the numbers you want, and set the variable to be some negative power of 10. E.g., the choice x=0.001 avoids digits rolling over until the desired numbers reach 1000. But we could take x=10^{-6} and get many more numbers at the cost of a more complicated fraction.

For example, how would one come up with 1/998001? We need a generating function for 1,2,3,4,…, that is, we need a formula for the power series \sum nt^n. No big deal: just take the derivative of (*):

\displaystyle \frac{1}{(1-t)^2}=\sum_{n=0}^{\infty} nt^{n-1}

and multiply both sides by t to restore the exponent:

\displaystyle (**) \qquad \frac{t}{(1-t)^2}=\sum_{n=0}^{\infty} nt^{n}

Now set t=0.001, which is easiest if you expand the denominator as 1-2t+t^2 and multiply both the numerator and denominator by 1000000. The result is

\displaystyle \frac{1000}{998001} = \sum_{n=0}^{\infty} n\,0.001^{n} = 0.001002003\dots

Dropping 1000 in the numerator is a matter of taste (cf. xkcd 163).

Let’s cook up something else. For example, again take the derivative in (**) and multiply by t:

\displaystyle \frac{t(1+t)}{(1-t)^3}=\sum_{n=0}^{\infty} n^2t^{n}

Now set t=0.001 to get

\displaystyle \frac{1001}{997002999} = 0.000\ 001\ 004\ 009\ 016\ 025\ 036\ 049\dots

Admittedly, this fraction is less likely to propagate around the web than 1/998001.

For the last example, take the Fibonacci numbers 1,1,2,3,5,8,13,… The recurrence relation F_{n+2}=F_n+F_{n+1} can be used to find the generating function, \displaystyle \frac{1}{1-t-t^2} = \sum F_n t^n. Setting t=0.001 yields

\displaystyle \frac{1}{998999} = 0.000\ 001\ 002\ 003\ 005\ 008\ 013\ 021\ 034\ 055\dots

3 thoughts on “Playing with numbers: 1/998001 and others”

  1. Fantastic explanation. So I guess the answer to the question “why was 998 skipped?” is really that it was not, but there was a domino effect with one of the digits from 1000 “rolling over” onto the 999, which picked up an extra digit and “rolled over” to 998, making it look like 999.

  2. It is easy to remove the domino effects of 1/998001. Notice we want to subtract 1000\sum_{n=1001}^2000 0.001^n, 2000\sum_{n=2001}^3000 0.001^n, and so on. Upon simplification this becomes \sum_{n=1}^\infty n [10^{-3000}]^{n-1} \frac{1-10^{-3000}}{0.999 \times 10^{3000}}. Exchanging derivative and limit, we have the result as exactly \frac{1}{0.999 \times 10^{3000}}. So the “ideal” faction should be 1/998001-\frac{1}{0.999 \times 10^{3000}}

  3. As another remark we should not pre-assume M and d discussed in the reply of the first comment; we have no idea of the magnitude of the coefficients of the power series. Thus additional computations should be used to determine M and d first.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.