I’ve been amusing myself with ${p}$-adic arithmetic lately: I’ve never really got to know it until now.

We are all familiar with the fact that every ${q\in\mathbf{Q}}$ gets represented in ${\mathbf{R}}$ as a repeating decimal, or whatever your favourite base is. (Here I count terminating decimals as decimals which eventually repeat ${000...}$.) The converse is of course true as well: repeating decimals are rationals.

Is this true in ${\mathbf{Q}_p}$ as well? That is, are the rationals precisely those ${p}$-adics which are eventually repeating (in the other direction, of course)? One direction, that repeating ${p}$-adics are rational, is pretty obvious: if ${a\in p^{-t}\mathbf{Z}}$ and ${b\in\mathbf{Z}}$ then

$\displaystyle a + b p^r + b p^{r+s} + b p^{r+2s} + \cdots = a + b \frac{p^r}{1 - p^s}$

is rational. What about the converse?

The converse seems trickier. How again did we do it in ${\mathbf{R}}$? I don’t even remember: it’s one of those things that we know so fundamentally (until very recently, ${\mathbf{Q}}$ was almost defined in my brain as the reals which eventually repeat) that we forget how to prove it.

Who cares how to prove it? It is true, and it says, in base ${p}$, that if ${q\in\mathbf{Q}}$ then there exists ${a\in p^{-t}\mathbf{Z}}$ and ${b\in\mathbf{Z}}$ such that

$\displaystyle q = a + b p^r + b p^{r-s} + b p^{r-2s} + \cdots = a + b \frac{p^r}{1 - p^{-s}}.$

But hey, this implies that

$\displaystyle q = a - b \frac{p^{r+s}}{1 - p^s},$

which we already know is a repeating ${p}$-adic.