7

Part of solving a bigger problem, I discovered that when dividing $1$ with a prime number $p$ > 11, the results has $p-1$ repeating decimals.

Examples: $\dfrac 1{23} = 0.\underline{0434782608695652173913}0434782608695...$

As far as I could tell, this happens for all primes I tested.

I can't at this time see the logic in this, but recall that Euler's Totient Function gives a result of $p-1$ for all primes $p$, so I tested to see if there were any other similarities between ETF and repeating decimals, but as far as I can see, it only "matches" primes.

I've search for more information about this, but have not been lucky yet.

Can anyone elaborate on this "phenomenon"?

4 Answers4

4

If $p=3$ you get $0.333333\ldots$, and you could say it has $p-1=2$ repeating digits and the part that repeats is $33$.

If $p=11$ you get $0.0909090909\ldots$, and you could say it has $p-1=10$ repeating digits, and the part that repeats is $0909090909$.

If $p=37$, you get $0.027027027\ldots$, and you could say it has $p-1=36$ repeating digits, and the part that repeats is $027\ldots027$ (with $12$ iterations of $027)$.

If $p=101$, you get $0.0099009900990099\ldots$, and you could say it has $p-1=100$ repeating digits, and the part that repeats is $0099$.

If $p=41$, you get $0.\underbrace{024390}_{\text{This repeats.}}$, and you could say it has $p-1=40$ repeating digits, and the part that repeats is eight iterations of that sequence of five digits.

If $p=13$, you get $0.\overbrace{076923}$ with a $6$-digit repetend, and you could say it has $p-1=12$ repeating digits, and the part that repeats is two iterations of $076923$.

$3$ is a divisor of $10^1 - 1$.

$11$ is a divisor of $10^2 - 1$.

$37$ is a divisor of $10^3-1$.

$101$ is a divisor of $10^4-1$.

$41$ is a divisor of $10^5-1$.

$13$ is a divisor of $10^6 - 1$.

The number of repeating digits in the shortest repetend in $1/p$ is the smallest exponent $k$ such that $p$ divides $10^k-1$.

If $41$ is a divisor of $10^5-1$, then $41$ is a divisor of $10^{40}-1$ since $$ 10^{40} - 1 = (10^5 - 1) \Big( (10^5)^7 + (10^5)^6 + (10^5)^5 + (10^5)^4 + (10^5)^3+(10^5)^2+(10^5)^1+1\Big). $$

  • Thanks Michael. Did not completely understand this, but will read through it again one or more times as well as looking up periodic decimals and Fermat's Theorem. – Ole Drews Jensen Nov 01 '15 at 05:15
  • @OleDrewsJensen : This should give some hints but it is not fully explicit. "fleablood"'s answer is also worth knowing. When you divide by $n$ you may at some point get $0$ as a remainder, but otherwise there are $n-1$ possible remainder, so you cannot go on for more than $n-1$ steps without seeing one you've seen before. Sometimes the repetend doesn't start right after the decimal point (as in $9773/101 = 101.80208,3333333333\ldots$ with $3$ repeating forever or $51/74=0.6,891,891,891,\ldots$), and sometimes it starts before the decimal point. ${}\qquad{}$ – Michael Hardy Nov 01 '15 at 05:23
  • $9773/96$ is a bit of a trick question: Some calculators show $101.80208$ and stop there (but this information is less than up-to-date; let's just pretend it is currently the year 1980). Then the student who hasn't learned the material writes on the exam that the thing that repeats is $8020$, thinking that that's what his calculator told him. ${}\qquad{}$ – Michael Hardy Nov 01 '15 at 05:26
  • Just why $49$ has a $42$-digit repetend (if I recall correctly) might also be interesting. ${}\qquad{}$ – Michael Hardy Nov 01 '15 at 05:32
3

Consider $\frac{1}{n}$ in base $m$, where $\gcd(n,m)=1$ for simplicity. We wish to multiply numerator and denominator by a number $k$ so that the denominator becomes $m^e-1$ for some exponent $e$.

Consider powers $1,m,m^2,\cdots$ mod $n$. This sequence repeats. That is, $m$ has some multiplicative order $e$ in the group of units mod $n$. Then $m^e-1=kn$ for some $k$.

We may conclude that

$$\frac{1}{n}=\frac{k}{kn}=\frac{k}{m^e-1}=p^{-e}\frac{k}{1-m^{-e}}=km^{-e}+km^{-2e}+km^{-3e}\cdots $$

Now, $k<m^e$ so is less than $e$ digits in base $m$, so the above exhibits the repeating base $m$ expansion of the fraction $\frac{1}{n}$, with period $e$.

There are $\varphi(n)$ elements in the group of units mod $n$, so the multiplicative order $e$ of $m$ mod $n$ must be a divisor of $\varphi(n)$. When $p$ is prime, $\varphi(p)=p-1$.

anon
  • 151,657
3

If a decimal $x$ repeats after $k$ digits, then the fraction is just that number over a bunch of 9's: $$x = a \big(1 + 10^{-k} + 10^{-2k} + \dots \big) = \frac{a}{1 - 10^{-k}}$$

Let's try the decimal number $\frac{1}{7} = 0.\overline{142857}$ then we can write the fraction as:

$$ \frac{1}{7} = \frac{142857}{999999} $$

Indeed we can check that $7 \times 142857 = 999999$


Fermat's little theorem has that $10^{p-1} \equiv 1 \mod p$ for any prime. Therefore $$ \frac{10^{p-1} - 1}{p} = a\in \mathbb{Z}$$

is always an integer. Then finally we can solve the equation for repeating decimal expansion:

$$ \frac{1}{p} = \frac{a}{10^{p-1} - 1} = (a \times 10^{1-p})(1 + 10^{1-p} + 10^{2(1-p)} + \dots)$$

This trick always works. Here is another instance there the 9's trick works. Here we get a string of 22 of them.

$$ 434782608695652173913 \times 23 =9\;999\;9 99\;999 \;999\;99 9\;999\;999$$


This a very special case of Markov partition in dynamical systems. We can always split $[0,1]$ into intervals:

$$ \big[0, \frac{1}{p}\big], \big[\frac{1}{p}, \frac{2}{p}\big],\dots \big[\frac{p-1}{p}, 1\big],$$

This partition behaves nicely with respect to the shift map $T: x \mapsto px (\mod 1)$...


See: Roy Adler Symbolic Dynamics and Markov Partitions.

cactus314
  • 24,438
2

When you divide p into 1 you get a remainder. When you divide p into that remaineder you get a second remainder. There are only p - 1 possible remainders. Once you go through them all they will repeat.

The only thing you need to figure out is why you will always have a remainder (because p, except 2 and 5, don't divide into 10) and why the remainders don't repeat until you've gone through all p-1 remainders. Except they don't. But their period will always divide p-1.

fleablood
  • 124,253
  • Thank you. That was a good explanation. – Ole Drews Jensen Nov 01 '15 at 05:08
  • However, 1/11 = .090909... only has two remainders - you never get all. – marty cohen Nov 01 '15 at 05:20
  • You sometimes get all. 23 gets all 22 and 7 gets all 6. but 11 gets 2|10. 37 gets 3|36. It depends on what is the smallest 10^n = 1 mod p. 10^(p-1) = 1 mod p but it might not be the smallest. if 10^n = 1 mod p is the smallest. (10^2 = 1 mod 11, 10^3 = 1 mod 37, etc) then n will be the smallest period. – fleablood Nov 01 '15 at 05:26