I am completely lost on what to do with the following problem.
Let $p$ be a natural number greater than $1$, and let $x$ be a real number with $0\leq x\leq 1$. Show that there is a sequence of integers $\{a_{n}\}$ with $0\leq a_{n}<p$ for each $n$ such that $x=\sum_{n=1}^{\infty}\frac{a_{n}}{p^{n}}$, and that the sequence is unique except when $x$ is of the form $\frac{q}{p^{n}}$, $0<p<q$, in which case there are exactly two such sequences.
Conversely, show that if $\{a_{n}\}$ is any sequence of integers with $0\leq a_{n}<p$, the series $\sum_{n=1}^{\infty}\frac{a_{n}}{p^{n}}$ converges to a real number $x$ with $0\leq x\leq 1$.
As I said, I am completely lost, so any help is appreciated!