How can I use "long division" in such a way as to get the n-ary expansion of a rational number instead of the decimal expansion? E.g. what would the long division of 866/5 look like in base 7? I'm working on showing that a number is in Q iff it has a terminating or periodic p-adic expansion, but I'm having trouble with that so I'm going over the fundamentals.
Asked
Active
Viewed 162 times
3
-
2Does this answer your question? Standard way to divide numbers of base other than 10. – José Carlos Santos Mar 17 '22 at 09:36
-
1$1/5=480/2400$ with $2400=7^4-1$ (= the lowest power $n$ such that $5\mid 7^n-1$), so in base seven $1/5=0.\overline{1254}$ as $480=1\cdot7^3+2\cdot7^2+5\cdot7^1+4\cdot7^0$. In $7$-adic expansion there are differences as $1/5$ is a $7$-adic integer. But using $5\mid 7^4-1$ is still relevant in determining the length of the eventual period. – Jyrki Lahtonen Mar 17 '22 at 09:41
-
2I don't agree with the duplicate. That calculation there is not very relevant for the purposes of finding the period. We may have a better duplicate though. – Jyrki Lahtonen Mar 17 '22 at 09:48
-
About (in particular terminating or periodic) $p$-adic expansions, K. Conrad's https://kconrad.math.uconn.edu/blurbs/gradnumthy/rationalsinQp.pdf is gold. Besides, answers to https://math.stackexchange.com/q/1186967/96384, https://math.stackexchange.com/q/1604657/96384, https://math.stackexchange.com/q/4164508/96384, https://math.stackexchange.com/q/2323324/96384 should give insight. – Torsten Schoeneberg Mar 17 '22 at 19:42
1 Answers
3
What follows is the long division base $7$: for example in an early row using $5 \times 3=2\times7 + 1 = 21_7$. Since the remainder starts to repeat, you get the periodic result $\frac{866_{10}}{5}=\frac{2345_7}{5}=335.\overline{1254}_7$.
Since there is a finite number of possible remainders, they must repeat and so you must get a periodic result for any rational in any base (counting terminating results as periodic $0$s). Jyrki Lahtonen's comment gives an approach which can help determine the length of the period.
335.1254...
==========
5 | 2345
21 5×3
----
245
21 5×3
---
35
34 5×5
--
1
0.5 5×1
---
0.2
13 5×2
----
4
34 5×5
--
3
26 5×4
--
1 repeated remainder
Henry
- 157,058