# Method of finding a p-adic expansion to a rational number

Could someone go though the method of finding a p-adic expansion of say $-\frac{1}{6}$ in $\mathbb{Z}_7?$

The short answer is, long division.

Say you want to find the $5$-adic expansion of $1/17$. You start by writing $$\frac{1}{17}=k+5q$$ with $k \in \{0,1,2,3,4\}$ and $q$ a $5$-adic integer (that is, a rational number with no powers of $5$ in the denominator). Then $k$ is the first term in the expansion, and you repeat the process with $q$ to find the remaining terms.

In this case, we have $$\frac{1}{17}=3+5\left(-\frac{10}{17}\right)$$ and so the first term is a $3$. Continuing similarly, $$-\frac{10}{17}=5\left(-\frac{2}{17}\right)$$ and so the second term is a $0$, $$-\frac{2}{17}=4 + 5\left(-\frac{14}{17}\right)$$ and so the third term is a $4$, $$-\frac{14}{17}= 3 + 5\left(-\frac{13}{17}\right)$$ and so the fourth term is a $3$, and so on.

Eventually, you'll hit a remainder for the second time, and then the expansion will start repeating (just as when you're computing the repeating decimal expansion of a fraction using ordinary long division).

• Thanks, I chose this answer because this gave a more general method. – user84899 Mar 12 '15 at 19:42
• @Micah In your first step $\frac{1}{17}=3+5\left(-\frac{10}{17}\right)$, how do you know which $k,q$ to choose? There are several possibilities, no? – Riley Jun 21 '15 at 8:58
• @Riley: There's only one possibility with $k \in \{0,1,2,3,4\}$ (as each term in a $5$-adic expansion must be). If you chose any other $k$ in that set, the numerator of the remainder wouldn't be a multiple of $5$. – Micah Jun 21 '15 at 15:20
• I am very new to $p$-adic theory. So I just want to know one thing, when you say "$5$-adic integer (that is, a rational number with no powers of $5$ in the denominator)", do you mean denominator is not divisible by $5$ or denominator is not a power of $5$? In particular for a prime $p$, when a rational $m/n$ is a $p$-adic integer.... In the case $p$ does not divide $n$ or $n$ is not a power of $p$? Thanks in advance – usermath Dec 20 '16 at 1:05
• @usermath: I mean the denominator is not divisible by $5$; a rational number $m/n$ is a $p$-adic integer iff $n$ is not a multiple of $p$. – Micah Dec 20 '16 at 1:28

In the case of $-1/6$, it’s very easy: $$-\frac{1}{6} = \frac{1}{1-7} = \sum_{k=0}^∞ 7^k.$$ What happens: In the $p$-adic numbers, the sequence $p^k$ is a null sequence (as $|p^k|_p = p^{-k} \overset{k → ∞}\longrightarrow 0$). Because of that and since the $p$-adic distance is ultra metric, this already ensures that the series $\sum_{k=0}^∞ p^k$ is converging – but that isn’t even needed: It’s a geometric series and so $$\sum_{k=0}^∞ p^k = \lim_{n→∞} \sum_{k=0}^n p^k = \lim_{n→∞}\frac{1-p^{n+1}}{1-p} = \frac{1}{1-p}.$$

This is done for $p = 7$ above.

• I wonder why is the last step right? $\sum_{k=0}^{\infty}p^k=\frac{1}{1-p}$ only if $|p|<1$ – Katherine Apr 20 '17 at 1:03
• @Katherine, With respect to the $p$-adic absolute value, this is true: $\lvert p \rvert_p = p^{-1} < 1$. – k.stm Apr 21 '17 at 8:30