Php problem of the period of a fraction

72 Views Asked by At

Question

A decimal representation of $\frac a b$ with coprime $a$, $b$ has at most period $b - 1$.

What does the period of this fraction mean?

1

There are 1 best solutions below

1
On

I think that it's something like this: the number $7/13$ is $0.53846153846\ldots$ You see how the sequence starting with "$538$" repeats? That sequence is 6 digits long, so the "period" for this decimal representation is $6$. '

More generally, if the sequence of digits after the decimal point is $d_1, d_2, \ldots$, then we say that the sequence is $n$-periodic (for $n > 0$) if there's a number $K$ such that $$ d_{i+n} = d_i $$ for all $i \ge K$.

Naturally, a sequence that's 3-periodic is also 6-periodic; we define the "period" of the sequence to be the smallest number $n$ such that the sequence is $n$-periodic.

Note that this definition works even if the number happens to have two different decimal representations, like $1.73999999$ and $1.7400$, both of which are $1$-periodic, and therefore the period is $1$. The "period" is undefined for a non-repeating decimal, of course; fortunately, the decimal representations of all rational numbers are in fact periodic, as you'll know when you've finished up your proof.