Recurring decimals and modular structure

#hsc-maths#sequences#advanced

This problem sits at a beautiful intersection of number theory and the familiar world of decimal expansions. Understanding why the period of 1p\frac1p divides p1p-1 takes you right into the multiplicative order of 1010 modulo pp, a concept that also underpins Fermat's Little Theorem. By working through the argument, you will see how modular arithmetic can reveal hidden structure in the repetend, including Midy's theorem – a classic result that often appears in HSC extension questions on sequences and series.

Problem Statement

Let pp be prime (p2,5p\neq2,5), and let nn be the period of 1p\frac1p.

  • Show n(p1)n\mid (p-1).
  • If n=2kn=2k, prove 10k1(modp)10^k\equiv-1\pmod p and the two half-blocks of the repetend sum to 10k110^k-1.

Hints

Factor 102k1=(10k1)(10k+1)10^{2k}-1=(10^k-1)(10^k+1) and use minimality of nn.


Solutions

The period nn of the decimal expansion 1p\frac1p is the smallest positive integer such that 10n1(modp)10^n \equiv 1 \pmod p; this is because the repeating block corresponds to the integer 10n1p\frac{10^n-1}{p}. Therefore nn is the multiplicative order of 1010 modulo pp. By Fermat's Little Theorem, 10p11(modp)10^{\,p-1}\equiv1\pmod p, and since the order divides any exponent giving 11, we must have n(p1)n\mid(p-1).

Now suppose the period is even, so n=2kn=2k. Because nn is the order, pp divides 102k110^{2k}-1. The minimality of n=2kn=2k tells us that 10k110^k-1 is not divisible by pp, so p(10k1)p\nmid(10^k-1). Factoring 102k1=(10k1)(10k+1)10^{2k}-1=(10^k-1)(10^k+1) forces pp to divide the other factor, thus p(10k+1)p\mid(10^k+1), which yields 10k1(modp)10^k\equiv-1\pmod p.

With 10k1(modp)10^k\equiv-1\pmod p in hand, look at the repetend itself. Write the repeating block of length 2k2k as two kk-digit blocks: let AA be the first half and BB the second half, so that

1p=0.AB=A10k+B102k+\frac1p = 0.\overline{A\,B} = \frac{A}{10^k} + \frac{B}{10^{2k}} + \cdots

Using 10k1(modp)10^k\equiv-1\pmod p and the geometric series expansion, one obtains Midy's theorem:

A+B=10k1.A+B = 10^k-1.

Takeaways

  • The period of 1p\frac1p is the order of 1010 modulo pp, so it must divide p1p-1 – a direct consequence of Fermat's Little Theorem.
  • When the period is even, the repetend splits into two halves that sum to 10k110^k-1 (a string of nines). This property, known as Midy's theorem, can be a handy shortcut for checking divisibility or for constructing fractions with prescribed repetends.
  • This problem shows how modular arithmetic reveals structure in everyday decimal expansions, linking sequences, number theory, and calculus in one neat package.

Further Readings

HSC Trigonometry, HSC Proofs, HSC Combinatorics, HSC Integrals

Written by Vu Hung Nguyen

Mathematics Educator · LinkedIn · About