So I stumbled on this by accident. Turns out that for example 1/17 has a period of 16 decimals, 1/19 has 18, 1/23 has 22 and lastly 1/97 has 96. So is it a general rule that for 1/n, if n is prime then the length of the period is n-1? If so why? It also works for 1/7 which is 6 repeating decimals. Thank you so much!
Asked
Active
Viewed 111 times
1
-
1Welcome to Mathematics Stack Exchange. Because of Fermat's little theorem, the length of the period of the reciprocal of a prime $p$ divides $p-1$; for example, the period of $1/11$, which is $2$, divides $10$, and the period of $1/13$, which is $6$, divides $12$ – J. W. Tanner Apr 12 '21 at 03:41
-
Oh ok thank you, did not know about that theorem – Cristian Apr 12 '21 at 03:42
-
Cf. this question – J. W. Tanner Apr 12 '21 at 03:47
1 Answers
1
$\frac1{11}$ repeats with period only $2$ in base $10$. The correct formula for the repeat length of $\frac1p$ is the order of $10$ modulo $p$, i.e. the least $k$ with $10^k\equiv1\bmod p$. This is equal to $p-1$ precisely when $10$ is a primitive root modulo $p$.

Parcly Taxel
- 103,344