Take the 2-minute tour ×
MathOverflow is a question and answer site for professional mathematicians. It's 100% free, no registration required.

Is there a way to calculate the number of non-repeating digits that precede the periodic repeating portion of a decimal expansion? For example:

1/6 = 0.1666.... (there is 1 non repeating digit) **(Correction) 1/12 = 0.08333... (there are 2 non repeating digits) 7/12 = 0.58333....(there are 2 non repeating digits) 1/96 = 0.01041666..(there are 5 non repeating digits)

Do any forumulas exist for predicting the maximum length n, of the number of non repeating digits preceding the repeating portion?

I know that if the denominator of a fraction is n, the maximum length of the repeating periodic portion is n-1. Must also the length of the preceding portion before the cycle be n-1?

Thank you!

share|improve this question
1/6 is 0.1666... ; 1/7 is 0.142857... –  J. M. Oct 11 '10 at 1:53
Otherwise, this might be more suitable for math.stackexchange.com –  J. M. Oct 11 '10 at 1:54
1/6 = 0.16666...thanks for the correction –  user9934 Oct 11 '10 at 1:59
That 1/11 is really 1/12. –  Gerry Myerson Oct 11 '10 at 2:28

1 Answer 1

up vote 4 down vote accepted

When one writes an irreducible fraction $m/n$ as a periodic digit number all one does is to write


So the number of digits before the period is the maximum of the power of $2$ and $5$ in $n$, i.e. wirting $n=2^\alpha 5^\beta k$ with $k$ relatively prime to $10$, the number of digits before the period is $\max\{\alpha, \beta \}$.

I think that this will follow for free from the following lemma, whose proof is trivial:

Lemma: if gcd$(k,10) =1$ then $k$ has a multiple of the form $999...9$.

share|improve this answer
So stated another way, the number of non-repeating decimals is equal to the number of times the denominator is divisible by either 5 or 2. For example, 1/12, 12 is divisible by 2, 2 times, and there are 2 non-repeating digits. 1/96, 96 is divisible by 2 - 5 times... Do you recommend a good number theory book that explains this in more depth? Thank you Nick! –  user9934 Oct 11 '10 at 3:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.