Trying to prove:

Let $p > 5$ be a prime and let $k$ be any positive integer $< p$. Show that the decimal expansion of $\frac{k}{p}$ consists of (p-1) repeating decimal digits. (hint: use Fermat's Little Theorem and Geometric Series).

I was trying to understand the theorem using an example but I am not very sure about why (p-1) repeating decimal digits.

E.g suppose $p = 11$, k = $4$, $5$, $7$.

  • $\frac{4}{11} = 0.36363636363636\ldots$
  • $\frac{5}{11} = 0.454545454545454545\ldots$
  • $\frac{7}{11} = 0.63636363636363636\ldots$

So where does $p-1 = 10$ come from? It seems the repeating length is always $2$.

  • $\begingroup$ Maybe $p-1$ does not need to be the minimal period, so since $2\mid10$ that is sufficient. $\endgroup$
    – YiFan Tey
    Oct 17, 2019 at 23:29
  • $\begingroup$ Consider the consequences of $10^{p-1}\equiv1\pmod{p}$ and how one computes $1/p$ in base ten. (Look at the remainders.) $\endgroup$
    – robjohn
    Oct 17, 2019 at 23:35
  • 1
    $\begingroup$ @robjohn but still why (p-1) in the example? It seems not right based on the example I gave. $\endgroup$
    – Jerry_Ge
    Oct 17, 2019 at 23:38
  • $\begingroup$ @Jerry_Ge: Did you read YiFan's comment? $0.\overline{6363636363}$ has a period of $10$, but also a period of $2$. $\endgroup$
    – robjohn
    Oct 18, 2019 at 1:51
  • $\begingroup$ This might help: math.stackexchange.com/q/3295196/597411 $\endgroup$
    – C. Melton
    Oct 18, 2019 at 3:44

1 Answer 1


If $10^{p-1} = 1 + mp$, where $1 < m < 10^{p-1}$, that says $$ \frac{1}{p} = \frac{m}{10^{p-1}-1} = \frac{m}{10^{p-1}(1-10^{-p+1})} = \sum_{j=1}^\infty \frac{m}{10^{j(p-1)}} $$ The decimal representation of this sum consists of "$0.$" followed by the digits of $m$ (padded at the front with zeros if necessary to length $p-1$) repeated: each term of the sum represents one block of $p-1$ digits.

Nobody said that $p-1$ has to be the smallest period. You can consider $4/11$ as $0.(36)(36)(36)\ldots$ with period $2$, but you could also write it as $0.(3636363636)(3636363636)\ldots$ with period $10=11-1$. An example where $p-1$ is the smallest period is $$1/7 = 0.(142857)(142857)\ldots$$

  • $\begingroup$ Thanks for the clarification! 1. Curious how you get from m/(10^(p-1)(1-10^{-p+1}) to the summation using geometric series? [Seems not intuitive for me] 2. why p <= 5 will not work? $\endgroup$
    – Jerry_Ge
    Oct 18, 2019 at 16:13
  • $\begingroup$ @Jerry_Ge: $p=3$ works. But $p=2$ and $p=5$ don't work, because the decimal expansions of $k/2$ and $k/5$ terminate. $\endgroup$
    – TonyK
    Nov 23, 2019 at 19:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .