[Math] Prove that a number is rational if and only if it has a finite or periodic representation on every base

number-systemsrational numbers

How do we go about proving:

$q$ is rational $\iff$ $q$ has a finite or periodic representation on every natural base $n>1$?


In other words, we need to prove each of the following statements:

  1. $q$ is rational $\implies$ $q$ has a finite or periodic representation on every natural base $n>1$
  2. $q$ has a finite or periodic representation on every natural base $n>1$ $\implies$ $q$ is rational

The second one is easy:

  • Choose some base $b>1$
  • If $q$ has a finite representation on base $b$:
    • Let $n$ be the number of digits after the point in $q_b$
    • Then $q$ is equal to the integer $qb^n$ divided by the integer $b^n$
  • If $q$ has a periodic representation on base $b$:
    • Let $n$ be the number of periodic digits after the point in $q_b$
    • Let $d$ be the integer represented by the periodic digits after the point in $q_b$
    • Then $q$ is equal to the integer $\lfloor{q}\rfloor\cdot(b^n-1)+d$ divided by the integer $b^n-1$

How can we prove the first one?

Best Answer

You divide the denominator into the numerator and get a remainder, then you continue to divide the numerator into the remainder (or n times the remainder) to get the decimal expansion. There are only finitely many remainders, so it will repeat or end.