How can you predict the number of recurring digits when a rational recurring fraction is converted to a decimal?

How can you predict the number of recurring digits when a rational recurring fraction is converted to a decimal? For example how could I predict the number of recurring digits in 1/9 based off a rule for its denominator? If possible can you please provide worked examples.

I currently have 10^m-1/C = E Z^+ where C = the denominator of the fraction. Is there a way to find m without guess and check.

• For denominator $d$ it is the order of $10\pmod d$. Since the order of $10\pmod 9$ is $1$, the period should be $1$. See this for example. – lulu Apr 19 '18 at 11:10

The answer to this involves the arcane subject of primitive roots. However, without going into all the details about primitive roots, the simplest answer is this: If we find the smallest number for any prime denominator, p, such that 10^(p-1)=1 mod p, then that is the number of recurring decimal places in the fraction 1/p. The answer is never more than p-1 and often a sub-multiple of p-1.

Here are some examples: (Denominator > No. of recurring decimal digits);

3 > 1, because 10 = 1 mod 3.

7 > 6, because 10^6 = 1 mod 7.

11 > 2, because 10^2 = 1 mod 11 (2 is a sub-multiple of 10).

13 > 6, because 10^6 = 1 mod 13 (6 is a sub-multiple of 12).

17 >16, because 10^16 = 1 mod 17.

19 > 18, because 10^18 = 1 mod 19

23 > 22, because 10^22 = 1 mod 23

29 > 28, because 10^28 = 1 mod 29

31 > 15, because 10^15 = 1 mod 31 (15 is a sub-multiple of 30)

etc

• @Bunga: The modulo operator tells you the unique remainder after division so that $a\mod b$ is the remainder of $a$ divided by $b$. – String Apr 19 '18 at 11:46
• @Bunga: Hence your examples are incorrect. $1\mod 7=1$ etc. – String Apr 19 '18 at 11:47
• I suggest that you study modulo arithmetic which involves only integers and no fractions. – user553944 Apr 20 '18 at 6:43