# Structure of Recurring Decimal

## Theorem

Let $\dfrac 1 m$, when expressed as a decimal expansion, recur with a period of $p$ digits with no nonperiodic part.

Let $\dfrac 1 n$, when expressed as a decimal expansion, terminate after $q$ digits.

Then $\dfrac 1 {m n}$ has a nonperiodic part of $q$ digits, and a recurring part of $p$ digits.

## Proof

Let $b \in \N_{>1}$ be the base we are working on.

Note that $b^p \times \dfrac 1 m$ is the result of shifting the decimal point of $\dfrac 1 m$ by $p$ digits.

Hence $b^p \times \dfrac 1 m - \dfrac 1 m$ is an integer, and $\paren {b^i - 1} \dfrac 1 m$ is not an integer for integers $0 < i < p$.

Therefore $m \divides b^p - 1$.

Also note that $b^q \times \dfrac 1 n$ is the result of shifting the decimal point of $\dfrac 1 n$ by $q$ digits.

Hence $b^q \times \dfrac 1 n$ is an integer, and $b^j \times \dfrac 1 n$ is not an integer for integers $0 < j < q$.

Therefore $n \divides b^q$ and $n \nmid b^{q - 1}$.

Write $m x = b^p - 1$ and $n y = b^q$.

Then $\dfrac 1 {m n} = \dfrac {x y} {\paren {b^p - 1} b^q}$.

$\exists! r, s \in \Z: x y = s \paren {b^p - 1} + r, 0 \le r < b^p - 1$

Then we would have:

$\dfrac 1 {m n} = \dfrac {s \paren {b^p - 1} + r} {\paren {b^p - 1} b^q} = \dfrac s {b^q} + \dfrac r {\paren {b^p - 1} b^q}$

which is a fraction with a nonperiodic part of $q$ digits equal to $s$, followed by a recurring part of $p$ digits equal to $r$.

To show that the nonperiodic part and recurring part of $\dfrac 1 {m n}$ cannot be shorter, we must show:

$r \not \equiv s \pmod b$: or else the nonperiodic part could be shortened by at least $1$ digit
$\dfrac r {b^p - 1} \paren {b^i - 1}$ is not an integer for integers $0 < i < p$: or else the recurring part could be shortened to $i$ digits

To show the first condition, suppose the contrary.

Then:

 $\ds x y$ $=$ $\ds s \paren {b^p - 1} + r$ $\ds$ $\equiv$ $\ds s \paren {b^p - 1} + s$ $\ds \pmod b$ $\ds$ $\equiv$ $\ds s b^p$ $\ds \pmod b$ $\ds$ $\equiv$ $\ds 0$ $\ds \pmod b$

From GCD with Remainder:

$\gcd \set {b, b^p - 1} = 1$

Since $x \divides b^p - 1$, by Divisor of One of Coprime Numbers is Coprime to Other:

$\gcd \set {b, x} = 1$
$b \divides y$

From $n y = b^q$:

$n \times \dfrac y b = b^{q - 1}$

so $n \divides b^{q - 1}$, which contradicts the properties of $n$.

To show the second condition, suppose the contrary.

Then:

 $\ds \paren {b^i - 1} \dfrac 1 m$ $=$ $\ds \dfrac {n \paren {b^i - 1} } {m n}$ $\ds$ $=$ $\ds n \paren {b^i - 1} \paren {\dfrac s {b^q} + \dfrac r {\paren {b^p - 1} b^q} }$ $\ds$ $=$ $\ds \dfrac n {b^q} \paren {s \paren {b^i - 1} + \dfrac {r \paren {b^i - 1} } {b^p - 1} }$

Both fractions are integers, so $\paren {b^i - 1} \dfrac 1 m$ is also an integer, which contradicts the properties of $\dfrac 1 m$.

Hence the result.

$\blacksquare$