p-adic expansions, the famous ...1111 = -1 result, and fractal tree visualization of Z_p
In the familiar real number system, we expand numbers in base 10 with digits extending to the right of the decimal point: 3.14159... The p-adic numbers turn this idea on its head. For a prime p, a p-adic integer is a sequence of digits in base p that extends infinitely to the left. Instead of approximating a number by adding smaller and smaller decimal fractions, we approximate by specifying its remainder modulo larger and larger powers of p.
This seemingly strange construction leads to a complete number system with its own notion of distance, convergence, and algebra. In the p-adic world, numbers that are divisible by high powers of p are considered "small," and the geometric series 1 + p + p² + ... actually converges -- to -1. The p-adic numbers are indispensable in modern number theory, from solving Diophantine equations to the proof of Fermat's Last Theorem.
Every integer has a unique representation as a finite sequence of digits in base p. Enter a number and watch its p-adic digits unfold from right to left. Try negative numbers to see the infinite repeating pattern that represents them.
Enter an integer and choose a prime to see its p-adic digit expansion, written from right (least significant) to left (extending toward infinity).
Key insight: Unlike decimal expansions that grow to the right, p-adic expansions grow to the left. A positive integer has finitely many nonzero p-adic digits, but a negative integer like -1 requires infinitely many -- this is not a bug but a feature of the p-adic number system.
Perhaps the most surprising fact about p-adic numbers: the infinite sum 1 + p + p² + p³ + ... converges to -1. Step through the partial sums and verify that at every level of precision (modulo pk), the partial sum agrees perfectly with -1.
The geometric series 1 + p + p² + p³ + ... converges to -1 in the p-adic numbers. Step through to see how partial sums approach -1 modulo increasing powers of p.
| k | Partial sum Sk | Sk value | Sk mod 2k+1 | -1 mod 2k+1 | Match? |
|---|---|---|---|---|---|
| 0 | 1 | 1 | 1 | 1 | = |
Key insight: This is not a trick or a formal manipulation. In the p-adic metric, the partial sums genuinely get closer and closer to -1. The formula (pn+1 - 1) / (p - 1) = -1 mod pn+1 holds for every n, which is exactly what p-adic convergence means.
The p-adic integers form a fractal-like structure that can be visualized as a tree. At each level, a node branches into p children, one for each possible digit. A p-adic integer corresponds to an infinite path through this tree, choosing one digit at each level.
Click nodes to build a 2-adic integer one digit at a time. Each level represents a digit position: the bottom level is the units digit, the next is the 2s digit, and so on.
Click a node in the tree to start building a 2-adic number. Begin with the bottom level (units digit) and work upward.
Key insight: The tree structure reveals the topology of the p-adic integers. Two numbers are "close" in the p-adic metric if and only if their paths through the tree agree for many levels. This branching structure makes the p-adic integers a Cantor set -- totally disconnected yet compact and uncountable.