Finding p-adic expansions of rational numbers Is there a general method for finding the $p$-adic expansion of any given rational number? I have seen a few concrete examples but cannot seem to find a general approach. There is a clear algorithmic approach for the integers (finding largest power of $p$ less than or equal to given integer etc. etc.). I would appreciate some guidance with this.
Thanks
 A: You might look at (1).  For representing $a/b \in \Bbb{Q}$ in $\Bbb{Q}_p$, the basic method (for rationals having $p$-adic absolute value $1$) is to solve the congruence $p^k \cong 1 \pmod{b}$ for $k$, so that $p^k - 1 = b \cdot c$, for some integer $c$.  Then 
$$  \frac{a \cdot c}{b \cdot c} = \frac{ac}{p^k - 1} = \frac{-ac}{1 - p^k}  \text{,}  $$
which, suggests a geometric series in powers of $p^k$.  Now express the integer $-ac$ in base $p$ and this is the sequence of digits repeating in the $p$-adic representation.
For $a/b > 0$, it is sometimes easier to compute the representation of $-a/b$, then negate the $p$-adic result.
For rationals having $p$-adic absolute value $\neq 1$, there is a preperiodic part of the expansions and a periodic part.  The periodic part is obtained similarly to the above.  The preperiodic part is a bit more work, as described in the linked article.
(1)  Conrad, K. "The $p$-adic expansion of rational numbers", https://kconrad.math.uconn.edu/blurbs/gradnumthy/rationalsinQp.pdf .
