Are there any bases which represent all rationals in a finite number of digits?

Solution 1:

Your intuition is correct for instance for all $b > 2$, $\frac{1}{b-1}$ is not going to have a finite representation, and will have the representation $\frac{1}{b-1} = 0.1111111...._b.$ Eg, $\frac{1}{9} = .11111111$ in base 10.

Solution 2:

A representation, though not positional, which yields a finite string for rational numbers is the Stern-Brocot representation which derives from the Stern-Brocot tree (also here).

The Stern-Brocot tree is a binary tree which can be used to enumerate all the rationals and which has useful applications in the rational approximation of real numbers. Here is a portion of this curious tree (the horizontal axis has a logarithmic scale):

enter image description here

Since the nodes of this special tree are in one-to-one correspondence with the rationals, one can represent each rational by a string which specifies how to walk down the tree, starting from the root 1/1, to reach the given rational. Since the tree is binary, a rational can be specified by a string of L(eft) and R(ight) letters. The representation is finite because all fractions can be reached with a finite number of turns.

For example, the fraction 8/5 can be specified by RLRL.

Real numbers have, instead, an infinite representation. For example, the golden ratio has the nice representation RLRLRLRLRL...

Solution 3:

A rational number $x$ has a finite digital expansion in base $b$ if and only if it's expressible as $a/b^n$ for an integer $a$ and some $n\ge1$. In particular $u/v$ (written in simplest terms) cannot be written in base $b$ if and only if the denominator $v>1$ has a prime factor that $b$ doesn't.

Solution 4:

In standard positional notation, no. Just pick any number p which is relatively prime to the base and 1/p will not terminate.

There is however a delightful way of doing this if we play a little bit loose and lovely with what is a "base", called "factorial base" (if you Google it, their are 6 million hits!). This has the exact property you ask for. Even if it doesn't meet your needs, it is a very interesting idea.