p-adic expansions, the famous ...1111 = -1 result, and fractal tree visualization of Z_p
Pick a prime p and write numbers with digits that run forever to the left. In this world -1 is an infinite string of digits, and a sum that blows up in the reals adds up to -1.
Enter an integer, pick a prime, and watch its base-p digits appear from right to left. Then try a negative number and notice that the digits never stop.
Enter an integer and choose a prime to see its p-adic digit expansion, written from right (least significant) to left (extending toward infinity).
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 divergent-looking series (p-1) + (p-1)p + (p-1)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.
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.
Step through the partial sums of (p-1) + (p-1)p + (p-1)p² + ... and check that at every level each one agrees with -1 modulo pk.
The series (p-1) + (p-1)p + (p-1)p² + ... -- the number whose base-p digits are all p-1 -- 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 | = |
Perhaps the most surprising fact about p-adic numbers: the infinite sum (p-1) + (p-1)p + (p-1)p² + ... -- the number whose base-p digits are all p-1 -- 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.
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 partial sum through the pn term equals pn+1 - 1 ≡ -1 mod pn+1for every n, which is exactly what p-adic convergence means.
Click through the tree to build a p-adic integer one digit at a time. Each node branches p ways, one for each possible digit.
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.
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.
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.
Spot a mistake or have an idea?