Loading...
July 7, 2026 at 8:01
English

How to Find the Period Length of a Repeating Decimal

Fractions of the form 1/n whose denominators have a prime factor other than 2 or 5 produce infinite decimals. But look at how beautiful their structure turns out to be — every one of them has a repeating cycle, and there are elegant ways to find exactly how long that cycle is.

Why Every Fraction Has a Repeating Decimal Period

A fraction always has a period. An infinite non-repeating decimal is impossible for a rational number.

The reason is simple: when dividing by n, the remainder can only take finitely many values. So the remainders are forced to start repeating sooner or later — and the moment they do, the decimal pattern loops back from the beginning.

Method 1: Finding the Repeating Decimal Period via the Order of 10

The period length of 1/n equals the smallest power of 10 that gives a remainder of 1 when divided by n.

For example, for 1/7:

10¹ / 7 → remainder 3
10² / 7 → remainder 2
10³ / 7 → remainder 6
10⁴ / 7 → remainder 4
10⁵ / 7 → remainder 5
10⁶ / 7 → remainder 1 (finally!!)

So the repeating decimal period for 1/7 equals 6. And indeed:

1/7 = 0.(142857)

Why does this work? It is essentially long division of 1 by 7. Once the remainder 1 reappears — the same value we started with — everything cycles back to the beginning.

Method 2: Using Euler’s Theorem to Find the Period Length Faster

There is Euler’s totient function φ(n) — the count of integers from 1 to n that are coprime to n.

From Euler’s theorem it follows that the period length always divides φ(n). This dramatically narrows the search.

For 1/7, φ(7) = 6, so it is enough to check only the divisors of 6: 1, 2, 3, 6.

Since 10¹, 10², and 10³ do not give a remainder of 1 when divided by 7 (as shown above), only 6 remains — and you do not even need to compute it explicitly.

The Hidden Puzzle of Maximum Repeating Decimal Periods

These are fairly straightforward methods for computing periods. But it turns out that periods conceal a much deeper mystery.

The maximum possible period is n − 1. This happens when the order of 10 modulo a prime p equals p − 1.

For example:

  • 1/7 has period 6 (maximum)
  • 1/17 has period 16 (maximum)
  • 1/13 has period only 6 (not maximum)

Question: for which primes p does the fraction 1/p produce a maximum-length repeating decimal period?

The answer will surprise you — it shows just how far a simple question from school mathematics can lead.

keyboard_arrow_up