Prime denominators and cycle length

#hsc-maths#sequences#advanced

When we write a fraction like 1p\frac{1}{p} as a decimal, the digits often fall into a repeating block — and the length of that block satisfies a beautiful number-theoretic property. This problem connects decimal expansions, modular arithmetic, and Fermat’s little theorem, giving you a powerful way to predict the period without doing the long division. By working through the steps, you’ll consolidate your understanding of orders modulo a prime, a topic that appears in both the Extension 1 and Extension 2 HSC courses.

Problem Statement

Let pp be prime, p2,5p\neq2,5, and LL be period length of 1p\frac1p.

  • Show LL is the least positive integer with 10L1(modp)10^L\equiv1\pmod p.
  • Deduce L(p1)L\mid(p-1).
  • Find periods for 137\frac1{37} and 141\frac1{41}.

Hints

Use Fermat's theorem and first occurrence of p(10n1)p\mid(10^n-1).


Solutions

We start by linking the period length LL to a divisibility condition. The standard theory of recurring decimals tells us that the block of length LL occurs because the remainder 10L10^L after multiplying and subtracting is 11, giving the fractional part exactly 1/p1/p shifted. This translates directly into the integer condition (10L1)/pZ(10^L-1)/p\in\mathbb{Z}, which is precisely the congruence 10L1(modp)10^L\equiv1\pmod p. The minimality of LL as the period length guarantees that no smaller positive exponent yields this congruence — LL is the least positive integer satisfying the relation.

To deduce that LL divides p1p-1 we bring in Fermat’s little theorem. Since pp does not divide 1010, we know 10p11(modp)10^{p-1}\equiv1\pmod p. The order of an element modulo pp — here the order of 1010 — always divides any exponent that returns 11. Our LL is exactly that order, so we must have L(p1)L\mid(p-1). This step reveals why the period of 1p\frac{1}{p} is always a factor of p1p-1, a delightful general fact.

Now we can check the specific primes. For p=37p=37, we test small nn to find the least positive integer with 37(10n1)37\mid(10^n-1).
1011=910^1-1=9 is not a multiple of 3737.
1021=9910^2-1=99 is not a multiple of 3737.
1031=99910^3-1=999; since 37×27=99937\times27=999, we have 37(1031)37\mid(10^3-1). No smaller nn works, so the period L=3L=3.
Similarly, for p=41p=41 we examine 10n110^n-1:
1011=910^1-1=9 is not divisible by 4141.
Checking further, 1051=9999910^5-1=99999 and 41×2439=9999941\times2439=99999, so 41(1051)41\mid(10^5-1). Because no smaller nn gives divisibility, the period is 55.


Takeaways

  • The period length of 1p\frac{1}{p} (for a prime p2,5p\neq2,5) is exactly the order of 1010 modulo pp, i.e. the smallest LL with 10L1(modp)10^L\equiv1\pmod p.
  • Fermat’s little theorem forces LL to divide p1p-1, giving a divisor upper bound on the period.
  • For a concrete prime, you can find LL by testing powers of 1010 until 10n110^n-1 becomes divisible by pp; the smallest such nn is the period.

Further Readings

HSC Integrals, HSC Inequalities, HSC Polys Ext 1, HSC Vectors

Written by Vu Hung Nguyen

Mathematics Educator · LinkedIn · About