# Do all rational numbers repeat in Fibonacci coding?

In a regular, positional number system (like our decimal numbers), every rational number ends in a repeating sequence (even if it’s just 0). For example, 1/3 in base 10 is 0.33333…, in base 5 it’s 0.131313…, and in base 3 it’s just 0.1.

A less common number system uses the Fibonacci sequence as its base, so the first few digit places represent 1, 2, 3, 5, 8, 13, 21, and so on (instead of the decimal 1, 10, 100, 1000, etc.). In this system:

\begin{aligned} 17_{10} &= 100101_F \\ 40_{10} &= 10001001_F \end{aligned}

This can easily be extended to digits after the radix point, so $0.1_F = \frac{1}{2}_{10}$, $0.01_F = \frac{1}{3}_{10}$, $0.001_F = \frac{1}{5}_{10}$, and so on.

\begin{aligned} \frac{5}{6}_{10} &= 0.11_F \\ \frac{7}{10}_{10} &= 0.101_F \end{aligned}

Some numbers aren’t as easy to write. Greedily adding up the first places that are smaller than the remainder of the number we’re trying to write:
$$\frac{1}{4} = \frac{1}{5}+\frac{1}{21}+\frac{1}{610}+\frac{1}{1597}… = 0.001001000000101…_F \\ \frac{2}{3} = \frac{1}{2}+\frac{1}{8}+\frac{1}{34}+\frac{1}{89}… = 0.10010010100001…_F$$

Do all rational numbers end in a repeating sequence in Fibonacci coding?

(For the specific case of $\frac{1}{4}$, see here.)