Decimal period from multiplicative order
ID: decimal-period-from-multiplicative-order
For a reduced fraction with , , and coprime integers, its decimal representation repeats immediately after the decimal point. The shortest repeating block has lengthHere denotes multiplicative order, and denotes Euler's totient function. Changing the numerator preserves the decimal period as long as the fraction remains reduced.[ref]
For example, long division of gives the remainders , with emitted digits . ConsequentlyEach remainder determines both the next digit and the next remainder; returning to one restarts the same six steps.
Long-division remainders explain the six-digit repeat of one seventh and the two-digit prefix of one twenty-eighth
. Details. More generally, initialize long division with . At each step, division with remainder givesso . Since are coprime integers, the modular inverse of shows that exactly when . To see why the digit block cannot repeat sooner than the remainders, a purely repeating decimal with a block of digits represents for an integer . A reduced fraction with that value forces . Hence the shortest digit repeat and the multiplicative order coincide.
Knowing the decimal period predicts how many digits must be computed and stored: one block determines the whole repeating decimal. It also constructs the block directly. With , the integeris the block, padded on the left with zeros to digits. For , and , so the block is and . Reduction matters: has decimal period one, whereas .
If the reduced denominator contains prime factors two or five, ten has no multiplicative order modulo that whole denominator. WriteThe decimal preperiod has exactly digits. If , the remaining repeating decimal has decimal period . For instance, gives : two prefix digits, then six repeating digits. If , the decimal representation is a terminating decimal with exactly fractional places. We use the representation ending in zeros, rather than its alternative ending in nines; for example terminates after three places.
A short derivation explains both cases. After digits, multiplying the reduced fraction by and discarding its integer part leaves a reduced fraction whose denominator is . This denominator first becomes coprime to ten at . It then equals , giving an immediate repeat when , or an integer when . The same long division argument works for positional notation in any base : for a reduced denominator coprime to , the shortest repeating block has length .
New to topics? Read the docs here!
