\documentclass[12pt]{article}
\usepackage{amsmath,amssymb}
\usepackage{times}
\usepackage[top=1in, bottom=1in, left=1.25in, right=1.25in]{geometry}

\newcommand{\Nats}{\mathbb{N}}
\parindent 0pt
\parskip 12pt

\begin{document}

{\bf Problem 1.21}\\
Show that a number $x\in[0,1]$ has more than one $p$-adic expansion
if and only if $x=\sum_{k=1}^n a_k/p^k$ for some $n$ where $a_n\neq 0$.
Show also that in this case $x$ has exactly one other expansion,
\begin{equation}
x=\sum_{k=1}^{n-1} a_k/p^k + \frac{a_{n}-1}{p^n} + \sum_{k=n+1}^\infty \frac{p-1}{p^n}.
\label{eq:padic-other}
\end{equation}
Also, characterize the numbers in $[0,1]$ with repeating and eventually
repeating $p$-adic expansions.

{\bf Solution}\\
Suppose $x$ has two different expansions,
\begin{align*}
x &= \sum_{k=1}^{\infty} \frac{a_k}{p^k}\\
  &= \sum_{k=1}^{\infty} \frac{b_k}{p^k}.
\end{align*}
Let $N$ be the index in which they first differ, and without loss of generality
assume that $a_N>b_N$.  We will show that $a_N=b_N+1$, $a_n=0$ for $n>N$, and $b_n=p-1$ for $n>N$.
This will prove that if $x$ has two different expansions, then one must be a terminating
expansion, and that the only other expansion is the one of the form (\ref{eq:padic-other}).

Let $y=\sum_{k=1}^{N-1}\frac{b_k}{p^k}$.  Then
\begin{align*}
x&\le \sum_{k=1}^{N-1}\frac{b_k}{p^k} + \frac{b_N}{p^N} +  \sum_{k=N+1}^{\infty}\frac{p-1}{p^k}\\
  & =  y + \frac{b_N}{p^N} + \frac{p-1}{p^{N+1}}\frac{p}{p-1}\\
  & =  y + \frac{b_N}{p^N} + \frac{1}{p^{N}}
\end{align*}
with strict inequality unless $b_n=p-1$ for all $n>N$.
Similarly,
\begin{align*}
x &\ge \sum_{k=1}^{N-1}\frac{a_k}{p^k} + \frac{a_N}{p^N} +  \sum_{k=N+1}^{\infty}\frac{0}{p^k}\\
  & = y + \frac{a_N}{p^N}
\end{align*}
with strict inequality unless $a_n=0$ for $n>N$. These inequalities together imply
$$
\frac{a_N}{p^N} \le \frac{b_N+1}{p^N}
$$
and hence $a_N\le b_N+1$ (with strict inequality unless $b_n=p-1$ and $a_n=0$ for $n>N$).  
But $a_N\ge b_N+1$ since $a_N>b_N$ and since $a_N$ and $b_N$ are integers.
Hence $a_N=b_N+1$ and $b_n=p-1$ and $a_n=0$ for $n>N$.

If $x$ has a terminating $p$-adic expansion, then $x$ is of the form
$$
x=\frac{a}{p^N}
$$
where $N\in\Nats$ and $0\le a\le p^N$.

If $x$ has a repeating $p$-adic expansion, then $x$ is of the form
$$
\frac{a}{p^N-1}
$$
where $N\in\Nats$ and where $0\le a\le p^N-1$.

If $x$ has an eventually repeating $p$-adic expansion, then $x$ 
can be decomposed into a terminating  and a repeating part.
So $x$ is of the form
$$
x= \frac{a}{p^N}+ \frac{1}{p^{N}}\frac{b}{p^M-1}
$$
where $N,M\in\Nats$, $0\le a <p^N$, and $0\le b\le p^M-1$.  This
is easily seen to be the same as
$$
x= \frac{d}{p^N(p^M-1)}
$$
for some $d$ with $0\le d \le p^N(p^M-1)$. It is perhaps surprising
that every rational admits an expression of this form.
	
\end{document}
