Every real number can be expressed by a decimal expansion.
Most numbers have a unique expansion, but some have two different expansions:
We are quite comfortable with numbers that carry on forever to the right of the decimal point. But have you ever considered numbers that carry on forever to the left?
This seems crazy, but let's see where the idea takes us.
First, let's try to figure out the value of
It appears that $\ldots 99999 + 1 = 0$ works out after all!
So $(\ldots 99999)^2 = \ldots 00001 = 1$, just as $(-1)^2 = 1$.
Common sense tells us that $\ldots 99999$ is not a number.

…but these “proofs” that $\ldots 99999 = -1$ make it feel like there's something there.
The main objection to $x$ being a number is that this sum clearly does not converge to a real number.
In 1897, Kurt Hensel discovered that we can build a rigorous mathematical theory of an alternate numerical universe in which infinite sums like this do converge:
A 10-adic number is an expression of the form
\[ \cdots + \vas{a_4}10^4 + \vas{a_3}10^3 + \vas{a_2}10^2 + \vas{a_1}10 + \vas{a_0} \]with digits $a_i$ satisfying $0 \leq a_i \leq 9$. We write $\ldots \vas{a_4a_3a_2a_1a_0}$ as a shorthand.
Addition and multiplication work just like you would expect.
If $\vas{a}$ and $\vas{b}$ are 10-adic numbers, then the $n$th digit of $\vas{a + b}$ or $\vas{a\cdot b}$ only depends on the $k$th digits of $\vas{a}$ and $\vas{b}$ with $k \leq n$.
Addition and multiplication work in the familiar way, but what about subtraction?
Can you see the shortcut for calculating the negative of a 10-adic number?
$-1 = \ldots 99999$
Consider the following 10-adic number with repeating digits,
We can use the same trick we used on $\ldots 99999$ to solve for $x$.
So $-\tfrac{1}{11}$ is a 10-adic number.
Some fractions live in $\ZZ_{10}$ too!
For which 10-adic numbers $n$ is $\tfrac{1}{n}$ also 10-adic?
I claim $\tfrac{1}{5}$ does not belong to $\ZZ_{10}$.
Some sequences of integers which obviously diverge in the real numbers $\RR$ turn out to converge in $\ZZ_{10}$.
| $2^{5^n}$ | $n$ |
|---|
The digits are stabilizing from the right.
The sequence $2^{5^n}$ converges to a limit in $\ZZ_{10}$!
What is this limit $b = \lim_{n\to\infty} 2^{5^n}$?
so $b = \ldots 879186432$ is a solution of the equation
\[ \vas{x^5 = x}. \]Recall that $b = \lim_{n\to\infty} 2^{5^n} = \ldots 879186432$ is a solution of
Thus $b$ must be a root of one of these factors.
$b \neq 0, \pm 1$, so $b$ must be a root of $x^2 + 1$.
Huh?
Consider the product $\,b(b^2 + 1)$.
Let's look at the powers of $b = \ldots 879186432$.
What happens if we replace $2$ and $5$ by different numbers?
| $n$ | $b^n$ |
|---|
If $mn = 0$, then $m = 0$ or $n = 0$.
$\ZZ_{10}$ does not have this property!
In other words, $\ZZ_{10}$ has zero divisors because $10$ is not prime.
For any integer $n \geq 2$, positive integers can be written in base $n$ using the digits $0, 1, \ldots, n-1$:
\[ 7 = \vas{1}\cdot 2^2 + \vas{1}\cdot 2 + \vas{1} = \vas{111} \ \text{(Base 2)}, \qquad\quad 7 = \vas{1}\cdot 5 + \vas{2} = \vas{12} \ \text{(Base 5)}. \]The $n$-adic numbers $\ZZ_n$ consist of all expressions of the form
\[ \cdots + \vas{a_4}n^4 + \vas{a_3}n^3 + \vas{a_2}n^2 + \vas{a_1}n + \vas{a_0}, \qquad 0 \leq a_i \leq n-1. \]If $n = p$ is a prime number, then there are no zero divisors in the $p$-adic numbers $\ZZ_p$.
Just as every number $n$ factors into a product of primes, every $n$-adic number system decomposes into a product of $p$-adics according to the factorization of $n$. \[ 10 = 2 \cdot 5 \,\,\Longrightarrow\,\, \ZZ_{10} \cong \ZZ_2 \times \ZZ_5 \]
This decomposition is (a fancy version of) the Chinese Remainder Theorem.
Every $10$-adic number decomposes into a $2$-adic and $5$-adic number in a way that respects arithmetic.
| $\ZZ_{10}$ | $\ZZ_2$ | $\ZZ_5$ |
|---|---|---|
| 7 | 111 | 12 |
| 100 | 1100100 | 400 |
| …830261947 | …010111011 | …021340242 |
| …999999999 | …111111111 | …444444444 |
| …666666667 | …010101011 | …131313132 |
| …909090909 | …001011101 | …211402114 |
Recall $b = \lim_{n\to\infty} 2^{5^n} = \ldots 879186432$.
| $b$ | $b_2$ | $b_5$ |
|---|---|---|
| …879186432 | …000000000 | …032431212 |
So $b_5 = \sqrt{-1}$ in $\ZZ_5$!
We saw that $\sqrt{-1} = \ldots 032431212$ in $\ZZ_5$. Does $\sqrt{-1}$ live in every $\ZZ_p$?
Suppose $(\ldots a_4 a_3 a_2 a_1 a_0)^2 = -1$ in $\ZZ_3$.
Hence we can never get a $2$ as the ones digit of a square.
Thus $\ZZ_3$ cannot have a square root of $-1$!
What is the pattern?
$\ZZ_p$ contains $\sqrt{-1}$ exactly when $p$ leaves a remainder of $1$ when divided by $4$.
How often is $p \equiv 1 \bmod 4$?
Chebyshev's bias
Following the dubious identity $\ldots 999999 = -1$ down the rabbit hole led us to the wonderful world of $p$-adic numbers.
We only get a complete picture by considering $\RR$ together with all the $p$-adics.