# Converting repeating decimal in base b to a fraction the same base

The repeating decimal .36666... in base 8 can be written in a fraction in base 8. I understand simple patterns such as 1/9 in base 10 is .1111.... so 1/7 in base 8 is .1111. But I'm not too sure how to convert this decimal in this base to the fraction in the same base.

• What about converting it to decimal, then base 8? It is $\frac{4}{11}$ and then convert to base 8? – Joshua Lochner Jul 24 '16 at 20:20

\begin{align} 0.3\bar{6}_8 &= \frac{3}{8} + 6\left(\frac{1}{8^2}+\frac{1}{8^3} + \cdots\right)\\ &= \frac{3}{8} + \frac{6}{8^2}\left(1+\frac{1}{8}+ \frac{1}{8^2} +\cdots\right)\\ &= \frac{3}{8} + \frac{6}{8^2}\frac{1}{1-(1/8)} & \text{geometric series}\\ &= \frac{3}{8} + \frac{3}{28}\\ &= \frac{27}{56}\\ &= \frac{33_8}{70_8}. \end{align}

• I noticed on second to step you converted the numerator and denominator separately to base 8 from base 10. So this that conversion apparently works in general? – Ian Limarta Jul 24 '16 at 20:28
• @cavern101 I guess you should ask yourself what a "fraction in base 8" means. – angryavian Jul 24 '16 at 20:32
• @cavern101: note that you could just as well do the same calculation as this answer does, writing everything in base 8 at all times, so it starts $(\frac{3}{10} + 6(\frac{1}{10^2} + \frac{1}{10^3} + ...)$, and then there would be no conversion to base 8 at the end. A base is just a way of writing down a number, it's still the same number regardless of how you write it. The only difficulty in doing it that way is that mental arithmetic in a base other than 10 is tricky, since a lot of things you remember (including multiplication tables) don't directly apply. – Steve Jessop Jul 25 '16 at 11:20

You could just do all your thinking in base 8. To save writing all the subscripts in the following computations I'll omit the base 8 designation. Legal digits are $0$ through $7$. It's a little mindbending, but only because we're used to base 10.

Let $x=0.3666\ldots$. Then

$$10x = 3.666\ldots = 3 + 6/7 = (25 + 6)/7 = 33/7$$

so $x=33/70$.

I used the facts that multiplying by 10 just shifts the "decimal" point, $3 \times 7 = 25$ and $6/7 = 0.66\ldots$.

• I think it's worth mentioning the justification for 0.666... = 6/7, which is that 0.111... = 1/(10-1) for any base. So it's 1/9 in base 10, and 1/7 in base 8. – hobbs Jul 25 '16 at 3:09
• @hobbs, that is, $$0.3666\ldots=\frac{3_8}{10_8}+\frac{6_8}{10_8}\frac{1_8}{7_8}$$ – J. M. is a poor mathematician Jul 25 '16 at 6:01
• @hobbs Where $a$ is a digit, $0.aaa... \equiv \frac{a}{10-1}$. – wizzwizz4 Jul 25 '16 at 7:29
• @hobbs I didn't elaborate on $6/7 = 0.666\ldots$ since the OP knows about $1/7 = 0.111\ldots$. – Ethan Bolker Jul 25 '16 at 12:11

We use subscript $8$ to denote base $8$ numbers, and all other numbers are base $10$. Take $x = 0.3\overline{6}_8$. Then $7x = 8x - x = 3.\overline{6}_8 - 0.3\overline{6}_8 = 3.3_8 = 27/8$. It follows that $x = 27/56 = 33_8/70_8$.

We compute directly in base $8$ as in base $10$:

Set $y=0.3666\dots$, $x=0.666\dots$. Then \begin{align*}8y&=3+0.666\dots=3+x\\ 8x&=6.666\dots=6+x \end{align*} Thus $$7x=6,\quad\text{so}\enspace x=\frac 67\enspace\text{and}\enspace 8y=3+\frac 67=\frac{3\times 7+6}7=\frac{25+6}7 =\frac{33}7,$$ because in base $8$, $\;3\times 7=25,\;5+6=13$, so that finally $\; y=\dfrac{33}{8\times7}=\color{red}{\dfrac{33}{70}}$.

• It's actually ${33}/{70}_8$ – Ian Limarta Jul 24 '16 at 20:48
• Oh! yes. I forgot the final division. Thanks for pointing it. – Bernard Jul 24 '16 at 20:52
• Your welcome sir! – Ian Limarta Jul 24 '16 at 20:53