TITLE: Non-completeness of $p$-adic metric on $\mathbb{Z}$
QUESTION [7 upvotes]: On $\mathbb{Z}$, we define the $p$-adic metric $d_p$ (for $p$ prime) as follows, for $m,n \in \mathbb Z$:

If $m=n$ then $d_p(m,n) =0$
If $m \neq n$ then $d_p(m,n) = \tfrac{1}{r+1}$ where $p^r \mid (m-n)$ but $p^{r+1} \not \mid(m-n)$

It's fairly straightforward to show that $d_p$ is a metric space (and infact a ultrametric space, I believe), however I'm having a bit of trouble showing that the space is not complete via the example
$$ a_n = 1 + p + p^2 + \cdots + p^n = \frac{1}{p-1}(p^{n+1} - 1) $$
While I've managed to show that $a_n$ is Cauchy, I'm finding it difficulty to try and prove that the sequence has no limit in $\mathbb{Z}$. Although the closed form given above makes it seem very intuitive that $a_n \to \tfrac{1}{1-p}$, and hence the limit is not in $\mathbb Z$, I can't see any way of doing this with the way $d_p$ is defined (as much as I would love to use the fact that $d_p(p^n,0) \to 0$, I can't see a valid way of taking the $\tfrac{1}{p-1}$ factor out). Is there any way I would be able to do this via the method above, or would I have to try some other method to show non-convergence?

REPLY [5 votes]: Note that the statement is only true for $2\not=p$ since if $2=p$ then $a_n \rightarrow -1$.
Suppose $a_n \rightarrow a\in \mathbb{Z}$. Then by the work in your question, the sequence $(p-1)a_n \rightarrow -1$. But by properties of metric spaces, $(p-1)a_n\rightarrow(p-1)a$. Thus $p=2$ and $a=-1$, so this is the only possible case.
Alternatively: Suppose $a_n \rightarrow a\in\mathbb{Z}$. Write $a=\pm(\sum_{i=0}^Nb_ip^i)$ where $N$ is the largest integer such that $p^N\leq |a|$ and  $0\leq b_i\leq p-1$ (which is possible to do by the Euclidean algorithm, we are really writing $a$ in base $p$ if you prefer to think of it like that.)
Now, what does using this representation of $a$ tell us about $d(a,a_n)$? (In particular, for $n > N$?)
Edit: The more I think about it, the more difficult it becomes to complete the proof simply with the alternative method. If anyone can do it in a line or two please leave a comment, otherwise I think that the first way is a lot neater.