In what base system a given decimal-based number with no terminating decimal expansion can be represented in a finite string of digits? I was reading about precision floating numbers in the mpmath python module documentation and came across this https://mpmath.org/doc/current/contexts.html#arbitrary-precision-interval-arithmetic-iv:

The fact that '0.1' results in an interval of nonzero width indicates
that 1/10 cannot be represented using binary floating-point numbers at
this precision level (in fact, it cannot be represented exactly at any
precision).

This made me wonder if there's a way to determine in what base system a given decimal-based number with no terminating decimal expansion can be transferred in order to be represented in a finite string of digits.
 A: It helps to understand why a certain number is terminating or non-terminating in a given base. Let us take base $b$. If you express a number $n$ in base $b$ as:
$$n=d_kd_{k-1}\cdots d_0 \space . \space d_{-1}d_{-2}\cdots d_{-l}$$
then this is equivalent to saying:
$$n=\sum_{i=-l}^k d_i \cdot b^i \implies b^ln=\sum_{i=0}^{k+l} d_{i-l} b^i$$
Now, it is clear that it is necessary $b^ln$ to be an integer for some $l \in \mathbb{N}$ for $n$ to terminate in base $b$. This is clearly a sufficient condition as well since if $b^ln$ is an integer, it clearly terminates in base $b$ (since all integers terminate in all bases), and thus, when dividing $b^ln$ by $b^l$, since it is base $b$, only digits move across the decimal point.
Hence, we have proven that a number $n$ terminates in base $b$ if and only if there exists $l \in \mathbb{N}$ such that $b^ln$ is an integer. This clearly cannot hold for irrational numbers $n$ since:
$$b^ln \in \mathbb{Z} \implies b^ln=t \implies n=\frac{t}{b^l}$$
where both $t$ and $b^l$ are non-zero integers, contradicting the fact that $n$ is irrational. Hence, irrational numbers are non-terminating in all bases.
Although, when you consider rational numbers, some rational numbers terminate in some bases but not in others. Consider the rational number $n=\frac{x}{y}$ in its simplest form. If $y$ has a prime factor $p$ that does not divide $b$, then no matter what $l$ you take, $b^ln$ will still have the prime factor $p$ in its denominator, and hence $b^ln$ cannot be an integer, which means that $n$ is non-terminating in base $b$.
If $y$ does not contain any such prime factor, then all prime factors of $y$ divide $b$. Define $l$ to be the largest power of a prime in the prime factorization of $y$. Then, it is clear that $b^ln$ is an integer since all the primes get cleared from the denominator. Hence, $n$ will terminate in base $b$.
Thus, a rational number is terminating in base $b$, if and only if for the denominator of $n$ in its simplest form, all its prime factors are also prime factors of $b$.
A: It depends what you mean by 'base system'. In base $\pi$, for instance, the units column is $1$, meaning that the 'tens' column is $\pi$, and so on. $\pi$ can be represented as $10$ in base $\pi$. However, if you require that the base is an integer, then no, there isn't an irrational number that can be written as a finite string. We can prove this by contraposition. If a number $n$ has a finite number of digits, then we can write the digits that come after the decimal point as
$$
.d_1d_2d_3\ldots d_k \, .
$$
This means that $$n=\text{integer part + }(b^{-1} \cdot d_1)+(b^{-2}\cdot d_2)+(b^{-3}\cdot d_3)+\ldots+(b^{-k}\cdot d_k) \, .$$The sum of finitely many rationals is rational. Hence, finite number of digits $\implies$ the number is rational. This means that irrational numbers can't have finitely many digits, and so they must have infinitely many digits.
