What Are p-adic Numbers?

p-adic expansions, the famous ...1111 = -1 result, and fractal tree visualization of Z_p

What Are p-adic Numbers?

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.

p-adic Expansion Explorer

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.

p-adic Expansion Explorer

Enter an integer and choose a prime to see its p-adic digit expansion, written from right (least significant) to left (extending toward infinity).

5-adic expansion of 42

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.

The Infinite Sum That Equals -1

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.

...1111 Equals Minus One

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.

2-adic representation of -1...1111
kPartial sum SkSk valueSk mod 2k+1-1 mod 2k+1Match?
01111=
Step 0: S0 = 1 = (21 - 1) / 1 = 1 / 1. Modulo 21 = 2, this equals 1, which is exactly -1 mod 2 = 1.
Step 1 / 8

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.

p-adic Number Tree

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.

p-adic Number Tree

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.

20212223000011011001101100011011001101

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.

Key Takeaways

  • Digits extend left -- p-adic numbers are written as sequences of base-p digits extending infinitely to the left, the mirror image of decimal expansions
  • A new notion of size -- in the p-adic world, divisibility by high powers of p makes a number "small," inverting our usual intuition
  • Divergent series converge -- the geometric series 1 + p + p² + ... diverges in the reals but converges to -1 in the p-adic numbers
  • Fractal structure -- the p-adic integers have a tree-like, self-similar topology that is totally disconnected yet rich with algebraic structure