# p-adic expansions for powers of p in the denominator

I read this question and the answer to it, which deals witht the case when the number we are dealing with is a p-adic integer. How does one find a p-adic expansion for a number that has a p factor in the denominator? E.g. how do we find the 5-adic expansion of $\frac{4}{5}$? Is it the same as the 5-adic expansion of 4 with the digits shifted one to the left?

$4/5 = 4\cdot 5^{-1}$ is already the $5$-adic expansion. $4/5\not\in\Bbb Z_5$, but $4/5\in\Bbb Q_5$. Remember that elements of $\Bbb Q_5$ can be expressed by sums of the form $$\sum_{i = n_0}^\infty a_i 5^i,$$ where $n_0$ is some integer (possibly negative) and $a_i\in\{0,1,2,3,4\}$ for all $i$. $4/5$ is already in this form, with $a_{-1} = 4$, and $a_i = 0$ for all other $i$. In general, you find the $5$-adic expansion of a nonzero fraction $a/b$ by factoring out the highest power of $5$ you can from both the numerator and denominator to get $\frac{a}{b} = 5^k \frac{a'}{b'}$, where $5\not\mid a'b'$, and then find the $5$-adic expansion of $\frac{a'}{b'}$ using the method described in the other question (basically via long division), and finally shift the expansion of $\frac{a'}{b'}$ appropriately depending on $k$ (multiply back in the $5^k$). The $5$-adic expansion of $\frac{a'}{b'}$ will need no negative powers of $5$, as you've factored them all out to obtain an element of $\Bbb Z_5$ (in fact, an element of $\Bbb Z_5^\times$).
(So, in short, it is simply the $5$-adic expansion of $4$ with the digits shifted.)
Start with the expansion for $4$, then just divide by $5$. Note that this corresponds to moving the decimal place over by $1$, since if you write the series as
$$4=\sum_{i=-\infty}^\infty a_i 5^i$$
then dividing by $5$ just gives
$${4\over 5}=\sum_{i=-\infty}^\infty a_i 5^{i-1}.$$