## p-adic Numbers I: When Big is Small

I can’t resist sharing something I just learned about this week.  p-adic numbers!  I discovered them while exploring angle sequences in creating Koch-like curves, and was immediately fascinated by them.  For example, we’ll see that in the field of 5-adic numbers,

$.....444444444 = -1.$

That’s right — the integer with infinitely many 4’s strung together is actually equal to $-1$!  This seems impossible at first glance, but is actually closely related to

$0.999999999..... = 1$

using decimal numbers.

The subject of p-adic numbers is a broad area in number theory, and we’ll only get a chance to  take a small glimpse into it.  The simplest examples to look at are related to geometric series.  We’ll briefly review them to refresh your memory.

Recall that

$a+ar+ar^2+ar^3+\cdots ar^n+\cdots=\dfrac a{1-r}$

when either $a=0$ or $|r|<1.$

When $r=1,$ for example, the series

$2+2+2+2+2+\cdots$

diverges.  To see this, we need to take the sequence of partial sums

$2, 2+2, 2+2+2, 2+2+2+2,\ldots = 2, 4, 6, 8, \ldots,$

which keeps getting larger and larger.  By contrast, the series

$1+\dfrac12+\dfrac14+\dfrac18+\cdots\dfrac1{2^n}\cdots$

converges because the sequence of partial sums

$1,1+\dfrac12,1+\dfrac12+\dfrac14,1+\dfrac12+\dfrac14+\dfrac18,\ldots=1,\dfrac32,\dfrac74,\dfrac{15}8,\ldots$

keeps getting closer and closer to 2.  Of course we can verify the sum with the formula

$\dfrac{a}{1-r}=\dfrac 1{1-1/2}=2.$

The key idea behind discussing convergence is creating a precise mathematical definition of “getting closer and closer to.”  This is done using limits (we will not need to go into details here) and the distance function on the real numbers:

$d(x,y)=|y-x|.$

Intuitively, the absolute value of the difference between two numbers is an indication of how close they are.

For a sequence like

$4, 44, 444, 4444, 44,\!444, \ldots,$

which are the partial sums of the geometric series

$4+40+400+4000+40,\!000+\cdots,$

it seems that the terms keep getting further and further apart:

$d(444,4444)=4000,\quad d(4444,44,\!444)=40,\!000,....$

In the field of p-adic numbers, closeness is measured a different way.  This might sound strange at first, but let’s consider closeness in plane geometry for a moment.

We are all familiar with the usual distance function in Euclidean geometry:

$d((x_1,y_1),(x_2,y_2))=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}.$

But maybe you weren’t aware that there are other ways to define distance in the plane — in fact, infinitely many ways — which give rise to non-Euclidean geometries.  One of the simplest is

$d_T((x_1,y_1),(x_2,y_2))=|x_2-x_1|+|y_2-y_1|.$

This is often called the taxicab distance, since it describes how far it is from one point to another if you took a taxi on a rectangular grid of streets.

For example, consider going from (0,0) to (3,2) — we’ll use blocks as units — if you could only walk north, south, east, or west.  The shortest path might be to go east three blocks, and then north two blocks.  Or perhaps north one block, east three blocks, and then north one block again.  But the shortest path will always require that you walk five blocks, since you aren’t allowed to walk along a diagonal path.  (Note that the shortest path is not always unique in taxicab geometry!)

This is a perfectly legitimate geometry, with its own set of properties.  For example, the “unit circle” described by the equation

$d_T((x,y),(0,0))=|x|+|y|=1$

is in fact not a circle at all, but a square with vertices at a distance of 1 along the axes!

But not any function for distance will work — for example, you’ve got to make sure the triangle inequality is still valid (and it is in taxicab geometry).  So while some properties still need to hold, most other properties won’t.

What does this have to do with p-adic numbers?  We’re going to look at the positive integers for now, but define close in a very different way.  So we can look at some specific examples, let’s take $p=5.$

Here’s the big leap:  we say a positive integer is 5-small if there are many factors of 5 in its prime factorization.  More specifically, if q is the largest power of 5 which is a factor of n, then the we say that its 5-“size” is

$|n|_5=\dfrac1{5^q}.$

Here are a few more examples, which you should be able to work out for yourself.

$|42|_5=1,\quad |250|_5=\dfrac1{125},\quad |10^{100}|_5=5^{-100}.$

But not everything big is small!  For example,

$|10^{100}+1|_5=1,$

since there are no factors of 5 present (which is true for any number ending in a 1).

This may seem odd at first, but when you read more about it, it’s actually amazing. I’ll have to admit that to understand a lot of the amazingness, you’d have to go to grad school in mathematics….  But we’ll get to look at a litte bit of it here.

Before we do, though, there’s another role that 5 plays.  We’ve got to write 5-adic numbers in base 5.  There’s not room to go into all the details here, but we’ll give a brief review.

Recall that in base 10, we have

$5432_{10}=2+3\times10+4\times10^2+5\times10^3.$

We can only use the digits 0–9.

Now in base 5, we can only use the digits 0–4, and we interpret the digits as follows:

$4302_5=2+0\times5+3\times5^2+4\times5^3=577_{10}.$

We add the same way as we do in base 10, except we carry when we add to more than 5 (and not 10).  Thus,

$4_5+3_5=12_5,\quad 34_5+12_5=101_5.$

Subtraction, multiplication, and division are handled similarly.

You won’t need to be an expert in base-5 arithmetic in order to understand how this applies to the equation

$.....444444444 = -1.$

But that will have to wait for the next post on p-adic numbers!  We’ll see why this is true, and maybe even talk a little bit about rational p-adic numbers, too….