# Thread: Quickie #14

1. ## Quickie #14

This is not really a "Quickie".
The solution is a bit longer, but it's quite clever.

In base $\displaystyle A$, the fraction $\displaystyle F_1 = 0.373737\hdots$ and the fraction $\displaystyle F_2 = 0.737373\hdots$

In base $\displaystyle B$, the fraction $\displaystyle F_1 = 0.252525\hdots$ and the fraction $\displaystyle F_2 = 0525252\hdots$

Find $\displaystyle A,\,B,\,F_1,\,F_2.$

2. Originally Posted by Soroban
This is not really a "Quickie".
The solution is a bit longer, but it's quite clever.

In base $\displaystyle A$, the fraction $\displaystyle F_1 = 0.373737\hdots$ and the fraction $\displaystyle F_2 = 0.737373\hdots$

In base $\displaystyle B$, the fraction $\displaystyle F_1 = 0.252525\hdots$ and the fraction $\displaystyle F_2 = 0525252\hdots$

Find $\displaystyle A,\,B,\,F_1,\,F_2.$
Observe that in any base that contains digits 1 through 7:

F_1=A F_2 - 7
F_1=B F_2 - 5

F_2=A F_1 - 3
F_2=B F_1 - 2

and solve.

The solution is F_1=1/3, F_2=2/3, A=11, B=8

RonL

3. Originally Posted by Soroban
This is not really a "Quickie".
The solution is a bit longer, but it's quite clever.

In base $\displaystyle A$, the fraction $\displaystyle F_1 = 0.373737\hdots$ and the fraction $\displaystyle F_2 = 0.737373\hdots$

In base $\displaystyle B$, the fraction $\displaystyle F_1 = 0.252525\hdots$ and the fraction $\displaystyle F_2 = 0525252\hdots$

Find $\displaystyle A,\,B,\,F_1,\,F_2.$

Hello Soroban,

if you multiply a fraction in "decimal" notation by the base you move the "decimal" point one digit to the right. (It's a more general rule to the SHR-command in assembler).

If you multiply F_2 by A then the digits after the "decimal" point are the same as at F_1. If you subtract F_1 from A*F_2 then you get an integer. If you multiply F_1 by A then the digits after the "decimal" point are the same as at F_2. If you subtract F_2 from A*F_1 then you get an integer.
This method will give 4 linear equations:

$\displaystyle \begin {array}{c} A \cdot F_2-F_1=7 \\ B \cdot F_2-F_1=5 \\ A \cdot F_1-F_2= 3 \\ B \cdot F_1-F_2=2 \end {array}$

I've got: A = 11, B= 8, F_1=1/3, F_3=2/3 (this time base 10)

EB

PS: As usual CaptainBlack is much faster than I

4. Hello, Captain Black and earboth!

I thought my book had a clever solution.
. . But yours are much shorter and more elegant.

I still want to show everyone the book's solution.
. . It has an interesting (unexpected) approach.

$\displaystyle F_1 \;=\;\frac{3A+7}{A^2} + \frac{3A+7}{A^4} + \frac{3A+7}{A^6} + \hdots\;=\;\frac{3A + 7}{A^2-1}$

$\displaystyle F_2\;=\;\frac{2B+5}{B^2} + \frac{2B+5}{B^4} + \frac{2B+5}{B^6} + \hdots\;=\;\frac{2B + 5}{B^2-1}$

. . Hence: .$\displaystyle F_1 \;=\;\frac{3A+7}{A^2-1}\;=\;\frac{2B+5}{B^2-1}$ [1]

Similarly: .$\displaystyle F_2\;=\;\frac{7A + 3}{A^2-1} \;=\;\frac{5B + 2}{B^2-1}$ [2]

Add [1] and [2]: .$\displaystyle F_1 + F_2 \;=\;\frac{3A + 7}{A^2-1} + \frac{7A + 3}{A^2-1} \;=\;\frac{2B+5}{B^2-1} + \frac{5B + 2}{B^2-1}$

. . $\displaystyle \frac{10A + 10}{A^2-1} \;=\;\frac{7B+7}{B^2-1}\quad\Rightarrow\quad\frac{10(A + 1)}{(A - 1)(A + 1)} \;=\;\frac{7(B+1)}{(B-1)(B+1)}$

. . $\displaystyle \frac{10}{A-1} \:=\:\frac{7}{B-1}\quad\Rightarrow\quad7A - 10B\:=\:-3$ [3]

Subtract [1] from [2]: .$\displaystyle F_2 - F_1\;=\;\frac{7A + 3}{A^2 - 1} - \frac{3A + 7}{A^2 - 1} \;=\;\frac{5B + 2}{B^2-1} - \frac{2B+5}{B^2-1}$

. . $\displaystyle \frac{4A - 4}{A^2-1} \;=\;\frac{3B - 3}{B^2-1}\quad\Rightarrow\quad\frac{4(A-1)}{(A-1)(A + 1)} \;=\;\frac{3(B-1)}{(B-1)(B+1)}$

. . $\displaystyle \frac{4}{A + 1} \;=\;\frac{3}{B + 1}\quad\Rightarrow\quad 3A - 4B \:=\:1$ [4]

[3] and [4] give us a system of equations: .$\displaystyle \begin{array}{cc}7A - 10B & = \:-3 \\ 3A - 4B & = \; 1 \end{array}$

. . with solutions: .$\displaystyle A = 11,\;B = 8$

Then: .$\displaystyle F_1 = \frac{1}{3},\;F_2 = \frac{2}{3}$

I agree . . . This solution is much longer.
But there are some interesting techniques involved
. . which I've added to my arsenal.