Q: When you write a fraction with a prime denominator in decimal form it repeats every p-1 digits. Why?

The original question was: How come the length of the repetend for some fractions (e.g. having a prime number p as a denominator) is equal to p-1?


Physicist: The question is about the fact that if you type a fraction into a calculator, the decimal that comes out repeats.  But it repeats in a very particular way.  For example,

\frac{1}{7} = 0.\underbrace{142857}_{repetend}142857142857\ldots

7 is a prime number and (you can check this) all fractions with a denominator of 7 repeat every 7-1=6 digits (even if it does so trivially with “000000”).  The trick to understanding why this happens in general is to look really hard at how division works.  That is to say: just do long division and see what happens.

When we say that \frac{1}{7} = 0.142857\ldots, what we mean is \frac{1}{7} = 0 + \frac{1}{10} + \frac{4}{10^2} + \frac{2}{10^3}+ \frac{8}{10^4}+ \frac{5}{10^5}+ \frac{7}{10^6}\ldots.  With that in mind, here’s why \frac{1}{7} = 0.142857\ldots.

\begin{array}{ll}  \frac{1}{7} \\[2mm]  = \frac{1}{10}\frac{10}{7} \\[2mm]  = \frac{1}{10} + \frac{1}{10}\frac{3}{7} \\[2mm]  = \frac{1}{10} + \frac{1}{10^2}\frac{30}{7} \\[2mm]  = \frac{1}{10} + \frac{4}{10^2} + \frac{1}{10^2}\frac{2}{7} \\[2mm]  = \frac{1}{10} + \frac{4}{10^2} + \frac{1}{10^3}\frac{20}{7} \\[2mm]  = \frac{1}{10} + \frac{4}{10^2} + \frac{2}{10^3} + \frac{1}{10^3}\frac{6}{7} \\[2mm]  \end{array}

and so on forever.  You’ll notice that the same thing is done to the numerator over and over: multiply by 10, divide by 7, the quotient is the digit in the decimal and the remainder gets carried to the next step, multiply by 10, ….  The remainder that gets carried from one step to the next is just \left[10^k\right]_7.

Quick aside: If you’re not familiar with modular arithmetic, there’s an old post here that has lots of examples (and a shallower learning curve).  The bracket notation I’m using here isn’t standard, just better.  “[4]3” should be read “4 mod 3”.  And because the remainder of 4 divided by 3 and the remainder of 1 divided by 3 are both 1, we can say “[4]3=[1]3“.

\begin{array}{l|l}\frac{1}{7}&[1]_7\\[2mm]=\frac{1}{10}\frac{10}{7}&[10]_7\\[2mm]=\frac{1}{10}+\frac{1}{10}\frac{3}{7}&[10]_7=[3]_7\\[2mm]=\frac{1}{10}+\frac{1}{10^2}\frac{30}{7}&[10^2]_7=[30]_7\\[2mm]=\frac{1}{10}+\frac{4}{10^2}+\frac{1}{10^2}\frac{2}{7}&[10^2]_7=[2]_7\\[2mm]=\frac{1}{10}+\frac{4}{10^2}+\frac{1}{10^3}\frac{20}{7}&[10^3]_7=[20]_7\\[2mm]=\frac{1}{10}+\frac{4}{10^2}+\frac{2}{10^3}+\frac{1}{10^3}\frac{6}{7}&[10^3]_7=[6]_7\\[2mm]  \end{array}

These aren’t the numbers that end up in the decimal expansion, they’re the remainder left over when you stop calculating the decimal expansion at any point.  What’s important about these numbers is that they each determine the next number in the decimal expansion, and they repeat every 6.

\begin{array}{ll}  [1]_7=1\\[2mm]  [10]_7=3\\[2mm]  [10^2]=2\\[2mm]  [10^3]=6\\[2mm]  [10^4]=4\\[2mm]  [10^5]=5\\[2mm]  [10^6]=1\end{array}

After this it repeats because, for example, [10^9]_7 = [10^3\cdot10^6]_7 = [10^3\cdot1]_7 = [10^3]_7.  If you want to change the numerator to, say, 4, then very little changes:

\begin{array}{l|l}\frac{4}{7}&[4]_7\\[2mm]=\frac{5}{10}+\frac{1}{10}\frac{5}{7}&[4\cdot10]_7=[5]_7\\[2mm]=\frac{5}{10}+\frac{7}{10^2}+\frac{1}{10^2}\frac{1}{7}&[4\cdot10^2]_7=[1]_7\\[2mm]=\frac{5}{10}+\frac{7}{10^2}+\frac{1}{10^3}+\frac{1}{10^3}\frac{3}{7}&[4\cdot10^3]_7=[3]_7\\[2mm]=\frac{5}{10}+\frac{7}{10^2}+\frac{1}{10^3}+\frac{4}{10^4}+\frac{1}{10^4}\frac{2}{7}&[4\cdot10^4]_7=[2]_7\\[2mm]=\frac{5}{10}+\frac{7}{10^2}+\frac{1}{10^3}+\frac{4}{10^4}+\frac{2}{10^5}+\frac{1}{10^5}\frac{6}{7}&[4\cdot10^5]_7=[6]_7\\[2mm]=\frac{5}{10}+\frac{7}{10^2}+\frac{1}{10^3}+\frac{4}{10^4}+\frac{2}{10^5}+\frac{8}{10^6}+\frac{1}{10^6}\frac{4}{7}&[4\cdot10^6]_7=[4]_7\\[2mm]\end{array}

So the important bit to look at is the remainder after each step.  More generally, the question of why a decimal expansion repeats can now be seen as the question of why [10^k]_P repeats every P-1, when P is prime.  For example, for \frac{2}{3} we’d be looking at [2\cdot10^k]_3 and for \frac{30}{11} we’d be looking at [30\cdot10^k]_{11}.  The “10” comes from the fact that we use a base 10 number system, but that’s not written in stone either (much love to my base 20 Mayan brothers and sisters.  Biix a beele’ex, y’all?).

It turns out that when the number in the denominator, M, is coprime to 10 (has no factors of 2 or 5), then the numbers generated by successive powers of ten (mod M) are always also coprime to M.  In the examples above M=7 and the powers of 10 generated {1,2,3,4,5,6} (in a scrambled order).  The number of numbers less than M that are coprime to M (have no factors in common with M) is denoted by ϕ(M), the “Euler phi of M”. For example, ϕ(9)=6, since {1,2,4,5,7,8} are all coprime to 9.  For a prime number, P, every number less than that number is coprime to it, so ϕ(P)=P-1.

When you find the decimal expansion of a fraction, you’re calculating successive powers of ten and taking the mod.  As long as 10 is coprime to the denominator, this generates numbers that are also coprime to the denominator.  If the denominator is prime, there are P-1 of these.  More generally, if the denominator is M, there are ϕ(M) of them.  For example, \frac{5}{21}=0.\underbrace{238095238095}238095238095\ldots, which repeats every 12 because ϕ(21)=12.  It also repeats every 6, but that doesn’t change the “every 12” thing.

Why the powers of ten must either hit every one of the ϕ(M) coprime numbers, or some fraction of ϕ(M) (\frac{\phi(M)}{2}, or \frac{\phi(M)}{3}, or …), thus forcing the decimal to repeat every ϕ(M) will be in the answer gravy below.


Answer Gravy: Here’s where the number theory steps in.  The best way to describe, in extreme generalization, what’s going on is to use “groups“.  A group is a set of things and an operation, with four properties: closure, inverses, identity, and associativity.

In this case the set of numbers we’re looking at are the numbers coprime to M, mod M.  If M=7, then our group is {1,2,3,4,5,6} with multiplication as the operator.  This group is denoted “\mathbb{Z}_7^\times“.

The numbers coprime to M are “closed” under multiplication, which means that if a\in\mathbb{Z}_7^\times and b\in\mathbb{Z}_7^\times, then a\cdot b\in\mathbb{Z}_7^\times.  This is because if you multiply two numbers with no factors in common with M, then you’ll get a new number with no factors in common with M.  For example, [3\cdot4]_7=[12]_7=[5]_7.  No 7’s in sight (other than the mod, which is 7).

The numbers coprime to M have inverses.  This is a consequence of Bézout’s lemma (proof in the link), which says that if a and M are coprime, then there are integers x and y such that xa+yM=1, with x coprime to M and y coprime to a.  Writing that using modular math, if a and M are coprime, then there exists an x such that [xa]_M=[1]_M.  For example, [1\cdot1]_7=[1]_7, [2\cdot4]_7=[1]_7, [3\cdot5]_7=[1]_7, and [6\cdot6]_7=[1]_7.  Here we’d write [3^{-1}]_7=[5]_7, which means “the inverse of 3 is 5”.

The numbers coprime to M have an identity element.  The identity element is the thing that doesn’t change any of the other elements.  In this case the identity is 1, because 1\cdot x=x in general.  1 is coprime to everything (it has no factors), so 1 is always in \mathbb{Z}_M^\times regardless of what M is.

Finally, the numbers coprime to M are associative, which means that (ab)c=a(bc).  This is because multiplication is associative.  No biggy.

 

So \mathbb{Z}_M^\times, the set of numbers (mod M) coprime to M, form a group under multiplication.  Exciting stuff.

But what we’re really interested in are “cyclic subgroups”.  “Cyclic groups” are generated by the same number raised to higher and higher powers.  For example in mod 7, {31,32,33,34,35,36}={3,2,6,4,5,1} is a cyclic group.  In fact, this is \mathbb{Z}_7^\times.  On the other hand, {21,22,23}={2,4,1} is a cyclic subgroup of \mathbb{Z}_7^\times.  A subgroup has all of the properties of a group itself (closure, inverses, identity, and associativity), but it’s a subset of a larger group.

In general, {a1,a2,…,ar} is always a group, and often is a subgroup.  The “r” there is called the “order of the group”, and it is the smallest number such that [a^r]_M=[1]_M.

Cyclic groups are closed because [a^x\cdot a^y]_M=[a^{x+y}]_M.

Cyclic groups contain the identity.  There are only a finite number of elements in the full group, \mathbb{Z}_M^\times, so eventually different powers of a will be the same.  Therefore,

\begin{array}{ll}    [a^x]_M=[a^y]_M \\[2mm]    \Rightarrow[a^x]_M=[a^xa^{y-x}]_M \\[2mm]    \Rightarrow[(a^x)^{-1}a^x]_M=[(a^x)^{-1}a^xa^{y-x}]_M \\[2mm]    \Rightarrow[1]_M=[a^{y-x}]_M    \end{array}

That is to say, if you get the same value for different powers, then the difference between those powers is the identity.  For example, [3^2]_7=[2]_7=[3^8]_7 and it’s no coincidence that [3^{8-2}]_7=[3^6]_7=[1]_7.

Cyclic groups contain inverses.  There is an r such that [a^r]_M=[1]_M.  It follows that [ba^x]_M=[1]_M\Rightarrow[ba^x]_M=[a^r]_M\Rightarrow[b]_M=[a^{r-x}]_M.  So, [\left(a^x\right)^{-1}]_M=[a^{r-x}]_M.

And cyclic subgroups have associativity.  Yet again: no biggy, that’s just how multiplication works.

 

It turns out that the number of elements in a subgroup always divides the number of elements in the group as a whole.  For example, \mathbb{Z}_M^\times={1,2,3,4,5,6} is a group with 6 elements, and the cyclic subgroup generated by 2, {1,2,4}, has 3 elements.  But check it: 3 divides 6.  This is Lagrange’s Theorem.  It comes about because cosets (which you get by multiplying every element in a subgroup by the same number) are always the same size and are always distinct.  For example (again in mod 7),

\begin{array}{rl}    1\cdot\{1,2,4\} & = \{1,2,4\} \\    2\cdot\{1,2,4\} & = \{2,4,1\} \\    3\cdot\{1,2,4\} & = \{3,6,5\} \\    4\cdot\{1,2,4\} & = \{4,1,2\} \\    5\cdot\{1,2,4\} & = \{5,3,6\} \\    6\cdot\{1,2,4\} & = \{6,5,3\} \\    \end{array}

The cosets here are {1,2,4} and {3,5,6}.  They’re the same size, they’re distinct, and together they hit every element in \mathbb{Z}_7^\times.  The cosets of any given subgroup are always the same size as the subgroup, always distinct (no shared elements), and always hit every element of the larger group.  This means that if the subgroup has S elements, there are C cosets, and the group as a whole has G elements, then SD=G.  Therefore, in general, the number of elements in a subgroup divides the number of elements in a whole group.

 

To sum up:

In order to calculate a decimal expansion (in base 10) you need to raise 10 to higher and higher powers and divide by the denominator, M.  The quotient is the next digit in the decimal and the remainder is what’s carried on to the next step.  The remainder is what the “mod” operation yields.  This leads us to consider the group of \mathbb{Z}_M^\times which is the multiplication mod M group of numbers coprime to M (the not-coprime-case will be considered in a damn minute).  \mathbb{Z}_M^\times has exactly ϕ(M) elements.  The powers of 10 form a “cyclic subgroup”.  The number of numbers in this cyclic subgroup must divide ϕ(M), by Lagrange’s theorem.

If P is prime, then ϕ(P)=P-1, and therefore if the denominator is prime the length of the cycle of digits in the decimal expansion (which is dictated by the cyclic subgroup generated by 10) must divide P-1.  That is, the decimal repeats every P-1, but it might also repeat every \frac{P-1}{2} or \frac{P-1}{3} or whatever.  You can also calculate ϕ(M) for M not prime, and the same idea holds.


Deep Gravy:

Finally, if the denominator is not coprime to 10 (e.g., 3/5, 1/2, 1/14, 71/15, etc.), then things get a little screwed up.  If the denominator is nothing but factors of 10, then the decimal is always finite.  For example, \frac{1}{8}=0.125\underbrace{0}_{repetend}000000.

\begin{array}{l|l}    \frac{1}{8}&[1]_8\\[2mm]    =\frac{1}{10}+\frac{1}{10}\frac{2}{8}&[10]_8=[2]_8\\[2mm]    =\frac{1}{10}+\frac{2}{10^2}+\frac{1}{10^2}\frac{4}{8}&[10^2]_8=[4]_8\\[2mm]    =\frac{1}{10}+\frac{2}{10^2}+\frac{5}{10^3}&[10^3]_8=[0]_8\\[2mm]    \end{array}

In general, if the denominator has powers of 2 or 5, then the resulting decimal will be a little messy for the first few digits (equal to the higher of the two powers, for example 8=23) and after that will follow the rules for the part of the denominator coprime to 10.  For example, 28=2^2\cdot7.  So, we can expect that after two digits the decimal expansion will settle into a nice six-digit repetend (because ϕ(7)=6).

Fortunately, the system works: \frac{1}{28}=0.03\underbrace{571428}571428\ldots

This can be understood by looking at the powers of ten for each of the factors of the denominator independently.  If A and B are coprime, then \mathbb{Z}_{AB}^\times \cong \mathbb{Z}_{A}^\times\otimes \mathbb{Z}_{B}^\times.  This is an isomorphism that works because of the Chinese Remainder Theorem.  So, a question about the powers of 10 mod 28 can be explored in terms of the powers of 10 mod 4 and mod 7.

\begin{array}{l|l}    [10]_{28}=[10]_{28} & \left([10]_{4},[10]_{7}\right) = \left([2]_{4},[3]_{7}\right) \\[2mm]    [10^2]_{28}=[16]_{28} & \left([10^2]_{4},[10^2]_{7}\right) = \left([0]_{4},[2]_{7}\right) \\[2mm]    [10]_{28}=[10]_{28} & \left([10]_{4},[10]_{7}\right) = \left([0]_{4},[3]_{7}\right) \\[2mm]    [10^3]_{28}=[20]_{28} & \left([10^3]_{4},[10^3]_{7}\right) = \left([0]_{4},[6]_{7}\right) \\[2mm]    \end{array}

Once the powers of 10 are a multiple of all of the of 2’s and 5’s in the denominator, they basically disappear and only the coprime component is important.

Numbers are a whole thing.  If you can believe it, this was supposed to be a short post.

This entry was posted in -- By the Physicist, Math, Number Theory. Bookmark the permalink.

13 Responses to Q: When you write a fraction with a prime denominator in decimal form it repeats every p-1 digits. Why?

  1. Tom says:

    You used Euler’s totient function phi to show the length of the cycle of digits in the decimal expansion and showed an example where phi(21)=12 but the smallest cycle was 6. Could you use Carmichael’s reduced totient function, lambda, to obtain a measure of the smallest cycle in a decimal expansion? Other than that, this was an excellent and entertaining post!

  2. Error: Unable to create directory uploads/2024/11. Is its parent directory writable by the server? The Physicist says:

    @Tom
    You are absolutely right! I’d never heard of the Carmichael function, but it is exactly what works.

  3. Flavian says:

    Entertaining post – true fitness for the brain. I love Mathematics posts by you. Grateful for your keeping up this good work. Cheers.

  4. William Rose says:

    This does not work for all primes in single digit prime, 2 nor 5 repeat except for zeros and 3 doesn’t repeat on n – 1 not n – 2 . So the first three primes don’t fit.

  5. Rob says:

    I never noticed the amount of repeating digits in a 1/prime in decimal form, there is one thing I’ve noticed about the digits of 1/7 that helps me to remember them.

    1/7=0. 14 28 57….
    Looking at the digits after the decimal point in groups of 2:
    14 = 7 * 2
    28 = 7 * 4
    57 = 7 * 8 + 1

    Is there a reason for this pattern as well, does the “+ 1” arise because of a carrying over somewhere?
    This almost works with the higher 1/prime numbers, although less so as they get bigger.

    1/11=0.0 90 90 90….
    If you start at the first significant digit,
    90 = 11 * 8 + 2

    1/13=0 76 92 30…
    Starting at the first significant digit:
    76 = 13 * 6 – 2
    92 = 13 * 7 + 1
    30 = 13 * 2 + 4

    1/17=0.0 58 82 35 29 41 17 64 70…
    58 = 17 * 3 + 7
    82 = 17 * 5 – 3
    35 = 17 * 2 + 1
    29 = 17 * 2 – 5
    41 = 17 * 2 + 7
    17 = 17 * 1
    64 = 17 * 4 – 4
    70 = 17 * 4 + 2

    There is kinda a pattern in 1/17, although maybe you can never be far off when your remainder has a max value of 6/10/12/16 and there’s just some coincidence involved

  6. steve tyler says:

    The length of the repitend is *exactly* the order of 10 in the multiplicative group of units mod p. (Somehow this seems not be explicitly stated anywhere)

  7. john says:

    1/7 1/17 1/19 1/47 1/59 1/61 1/97

    1/109 1/113 1/131 1/149 1/167 1/179 1/181 1/193

    1/223 1/229 1/233 1/257 1/263 1/269 1/293

    1/313 1/337 1/367 1/379 1/383 1/389

    1/419 1/433 1/461 1/487 1/491 1/499

    1/503 1/509 1/541 1/571 1/577 1/593

    1/619 1/647 1/659

    1/701 1/709 1/727 1/743

    1/821 1/823 1/857 1/863 1/887

    1/937 1/941 1/953 1/971

  8. john says:

    I call them interesting fractions,
    is there a practical use?
    It does seem sort of powerful to be able to
    describe a fraction, that repeats to so many places
    and be confident that is exact.

  9. Doing fraction solution manually is good thing because the knowledge will be kept refreshing but sometimes when you are doubtful with your answer, it will be good if you can have some reference or guidance to make sure your solution is correct. So fraction calculator would be handy in this case. Plus, if you are on doing it on a very short time, fraction calculator would really help you save time.

  10. Philipp G Blume says:

    {{“1/271”, 0.00369003690036900}, {“2/271”,
    0.00738007380073801}, {“3/271”, 0.0110701107011070}, {“4/271”,
    0.0147601476014760}, {“5/271”, 0.0184501845018450}, {“6/271”,
    0.0221402214022140}, {“7/271”, 0.0258302583025830}, {“8/271”,
    0.0295202952029520}, {“9/271”, 0.0332103321033210}, {“10/271”,
    0.0369003690036900}, {“11/271”, 0.0405904059040590}, {“12/271”,
    0.0442804428044280}, {“13/271”, 0.0479704797047970}, {“14/271”,
    0.0516605166051661}, {“15/271”, 0.0553505535055351}, {“16/271”,
    0.0590405904059041}, {“17/271”, 0.0627306273062731}, {“18/271”,
    0.0664206642066421}, {“19/271”, 0.0701107011070111}, {“20/271”,
    0.0738007380073801}, {“21/271”, 0.0774907749077491}, {“22/271”,
    0.0811808118081181}, {“23/271”, 0.0848708487084871}, {“24/271”,
    0.0885608856088561}, {“25/271”, 0.0922509225092251}, {“26/271”,
    0.0959409594095941}, {“27/271”, 0.0996309963099631}, {“28/271”,
    0.103321033210332}, {“29/271”, 0.107011070110701}, {“30/271”,
    0.110701107011070}, {“31/271”, 0.114391143911439}, {“32/271”,
    0.118081180811808}, {“33/271”, 0.121771217712177}, {“34/271”,
    0.125461254612546}, {“35/271”, 0.129151291512915}, {“36/271”,
    0.132841328413284}, {“37/271”, 0.136531365313653}, {“38/271”,
    0.140221402214022}, {“39/271”, 0.143911439114391}, {“40/271”,
    0.147601476014760}, {“41/271”, 0.151291512915129}, {“42/271”,
    0.154981549815498}, {“43/271”, 0.158671586715867}, {“44/271”,
    0.162361623616236}, {“45/271”, 0.166051660516605}, {“46/271”,
    0.169741697416974}, {“47/271”, 0.173431734317343}, {“48/271”,
    0.177121771217712}, {“49/271”, 0.180811808118081}, {“50/271”,
    0.184501845018450}, {“51/271”, 0.188191881918819}, {“52/271”,
    0.191881918819188}, {“53/271”, 0.195571955719557}, {“54/271”,
    0.199261992619926}, {“55/271”, 0.202952029520295}, {“56/271”,
    0.206642066420664}, {“57/271”, 0.210332103321033}, {“58/271”,
    0.214022140221402}, {“59/271”, 0.217712177121771}, {“60/271”,
    0.221402214022140}, {“61/271”, 0.225092250922509}, {“62/271”,
    0.228782287822878}, {“63/271”, 0.232472324723247}, {“64/271”,
    0.236162361623616}, {“65/271”, 0.239852398523985}, {“66/271”,
    0.243542435424354}, {“67/271”, 0.247232472324723}, {“68/271”,
    0.250922509225092}, {“69/271”, 0.254612546125461}, {“70/271”,
    0.258302583025830}, {“71/271”, 0.261992619926199}, {“72/271”,
    0.265682656826568}, {“73/271”, 0.269372693726937}, {“74/271”,
    0.273062730627306}, {“75/271”, 0.276752767527675}, {“76/271”,
    0.280442804428044}, {“77/271”, 0.284132841328413}, {“78/271”,
    0.287822878228782}, {“79/271”, 0.291512915129151}, {“80/271”,
    0.295202952029520}, {“81/271”, 0.298892988929889}, {“82/271”,
    0.302583025830258}, {“83/271”, 0.306273062730627}, {“84/271”,
    0.309963099630996}, {“85/271”, 0.313653136531365}, {“86/271”,
    0.317343173431734}, {“87/271”, 0.321033210332103}, {“88/271”,
    0.324723247232472}, {“89/271”, 0.328413284132841}, {“90/271”,
    0.332103321033210}, {“91/271”, 0.335793357933579}, {“92/271”,
    0.339483394833948}, {“93/271”, 0.343173431734317}, {“94/271”,
    0.346863468634686}, {“95/271”, 0.350553505535055}, {“96/271”,
    0.354243542435424}, {“97/271”, 0.357933579335793}, {“98/271”,
    0.361623616236162}, {“99/271”, 0.365313653136531}, {“100/271”,
    0.369003690036900}, {“101/271”, 0.372693726937269}, {“102/271”,
    0.376383763837638}, {“103/271”, 0.380073800738007}, {“104/271”,
    0.383763837638376}, {“105/271”, 0.387453874538745}, {“106/271”,
    0.391143911439114}, {“107/271”, 0.394833948339483}, {“108/271”,
    0.398523985239852}, {“109/271”, 0.402214022140221}, {“110/271”,
    0.405904059040590}, {“111/271”, 0.409594095940959}, {“112/271”,
    0.413284132841328}, {“113/271”, 0.416974169741697}, {“114/271”,
    0.420664206642066}, {“115/271”, 0.424354243542435}, {“116/271”,
    0.428044280442804}, {“117/271”, 0.431734317343173}, {“118/271”,
    0.435424354243542}, {“119/271”, 0.439114391143911}, {“120/271”,
    0.442804428044280}, {“121/271”, 0.446494464944649}, {“122/271”,
    0.450184501845018}, {“123/271”, 0.453874538745387}, {“124/271”,
    0.457564575645756}, {“125/271”, 0.461254612546125}, {“126/271”,
    0.464944649446494}, {“127/271”, 0.468634686346863}, {“128/271”,
    0.472324723247232}, {“129/271”, 0.476014760147601}, {“130/271”,
    0.479704797047970}, {“131/271”, 0.483394833948339}, {“132/271”,
    0.487084870848708}, {“133/271”, 0.490774907749077}, {“134/271”,
    0.494464944649446}, {“135/271”, 0.498154981549815}, {“136/271”,
    0.501845018450185}, {“137/271”, 0.505535055350554}, {“138/271”,
    0.509225092250923}, {“139/271”, 0.512915129151292}, {“140/271”,
    0.516605166051661}, {“141/271”, 0.520295202952030}, {“142/271”,
    0.523985239852399}, {“143/271”, 0.527675276752768}, {“144/271”,
    0.531365313653137}, {“145/271”, 0.535055350553506}, {“146/271”,
    0.538745387453875}, {“147/271”, 0.542435424354244}, {“148/271”,
    0.546125461254613}, {“149/271”, 0.549815498154982}, {“150/271”,
    0.553505535055351}, {“151/271”, 0.557195571955720}, {“152/271”,
    0.560885608856089}, {“153/271”, 0.564575645756458}, {“154/271”,
    0.568265682656827}, {“155/271”, 0.571955719557196}, {“156/271”,
    0.575645756457565}, {“157/271”, 0.579335793357934}, {“158/271”,
    0.583025830258303}, {“159/271”, 0.586715867158672}, {“160/271”,
    0.590405904059041}, {“161/271”, 0.594095940959410}, {“162/271”,
    0.597785977859779}, {“163/271”, 0.601476014760148}, {“164/271”,
    0.605166051660517}, {“165/271”, 0.608856088560886}, {“166/271”,
    0.612546125461255}, {“167/271”, 0.616236162361624}, {“168/271”,
    0.619926199261993}, {“169/271”, 0.623616236162362}, {“170/271”,
    0.627306273062731}, {“171/271”, 0.630996309963100}, {“172/271”,
    0.634686346863469}, {“173/271”, 0.638376383763838}, {“174/271”,
    0.642066420664207}, {“175/271”, 0.645756457564576}, {“176/271”,
    0.649446494464945}, {“177/271”, 0.653136531365314}, {“178/271”,
    0.656826568265683}, {“179/271”, 0.660516605166052}, {“180/271”,
    0.664206642066421}, {“181/271”, 0.667896678966790}, {“182/271”,
    0.671586715867159}, {“183/271”, 0.675276752767528}, {“184/271”,
    0.678966789667897}, {“185/271”, 0.682656826568266}, {“186/271”,
    0.686346863468635}, {“187/271”, 0.690036900369004}, {“188/271”,
    0.693726937269373}, {“189/271”, 0.697416974169742}, {“190/271”,
    0.701107011070111}, {“191/271”, 0.704797047970480}, {“192/271”,
    0.708487084870849}, {“193/271”, 0.712177121771218}, {“194/271”,
    0.715867158671587}, {“195/271”, 0.719557195571956}, {“196/271”,
    0.723247232472325}, {“197/271”, 0.726937269372694}, {“198/271”,
    0.730627306273063}, {“199/271”, 0.734317343173432}, {“200/271”,
    0.738007380073801}, {“201/271”, 0.741697416974170}, {“202/271”,
    0.745387453874539}, {“203/271”, 0.749077490774908}, {“204/271”,
    0.752767527675277}, {“205/271”, 0.756457564575646}, {“206/271”,
    0.760147601476015}, {“207/271”, 0.763837638376384}, {“208/271”,
    0.767527675276753}, {“209/271”, 0.771217712177122}, {“210/271”,
    0.774907749077491}, {“211/271”, 0.778597785977860}, {“212/271”,
    0.782287822878229}, {“213/271”, 0.785977859778598}, {“214/271”,
    0.789667896678967}, {“215/271”, 0.793357933579336}, {“216/271”,
    0.797047970479705}, {“217/271”, 0.800738007380074}, {“218/271”,
    0.804428044280443}, {“219/271”, 0.808118081180812}, {“220/271”,
    0.811808118081181}, {“221/271”, 0.815498154981550}, {“222/271”,
    0.819188191881919}, {“223/271”, 0.822878228782288}, {“224/271”,
    0.826568265682657}, {“225/271”, 0.830258302583026}, {“226/271”,
    0.833948339483395}, {“227/271”, 0.837638376383764}, {“228/271”,
    0.841328413284133}, {“229/271”, 0.845018450184502}, {“230/271”,
    0.848708487084871}, {“231/271”, 0.852398523985240}, {“232/271”,
    0.856088560885609}, {“233/271”, 0.859778597785978}, {“234/271”,
    0.863468634686347}, {“235/271”, 0.867158671586716}, {“236/271”,
    0.870848708487085}, {“237/271”, 0.874538745387454}, {“238/271”,
    0.878228782287823}, {“239/271”, 0.881918819188192}, {“240/271”,
    0.885608856088561}, {“241/271”, 0.889298892988930}, {“242/271”,
    0.892988929889299}, {“243/271”, 0.896678966789668}, {“244/271”,
    0.900369003690037}, {“245/271”, 0.904059040590406}, {“246/271”,
    0.907749077490775}, {“247/271”, 0.911439114391144}, {“248/271”,
    0.915129151291513}, {“249/271”, 0.918819188191882}, {“250/271”,
    0.922509225092251}, {“251/271”, 0.926199261992620}, {“252/271”,
    0.929889298892989}, {“253/271”, 0.933579335793358}, {“254/271”,
    0.937269372693727}, {“255/271”, 0.940959409594096}, {“256/271”,
    0.944649446494465}, {“257/271”, 0.948339483394834}, {“258/271”,
    0.952029520295203}, {“259/271”, 0.955719557195572}, {“260/271”,
    0.959409594095941}, {“261/271”, 0.963099630996310}, {“262/271”,
    0.966789667896679}, {“263/271”, 0.970479704797048}, {“264/271”,
    0.974169741697417}, {“265/271”, 0.977859778597786}, {“266/271”,
    0.981549815498155}, {“267/271”, 0.985239852398524}, {“268/271”,
    0.988929889298893}, {“269/271”, 0.992619926199262}, {“270/271”,
    0.996309963099631}}

  11. Alan Graham Robinson says:

    Some good answers here. But simple engineers like me need to be careful not to get the wrong idea. The title at the top of this page implies that ‘a fraction with a prime denominator in decimal form repeats every p-1 digits’. Well that is clearly not always the case. 1/11 for example is 0.090909…. and 1/13 is 0.076923076923… I was hoping to find a method of finding the simplest expression resulting from adding two fractions without using prime factors, and got the idea to convert the fraction into its decimal equivalents, add the decimals, then convert their sum back into a fraction. This works fine, except the repeated patterns get too long for practical application. All I can conclude is that the decimal equivalent of a fraction is rational, so either it terminates or it has a pattern that repeats to infinity … and those patterns get too long for practical people like me.

  12. stephanie Findlay says:

    I am not a mathematician but an artist so I cannot understand maths jargon and formulas, but I wonder if you can tell me if it is known how to break down a number like 1/89 which has a repeating block of 44 digits into all of its divisors. Can this be done for all the repeating blocks,of any size without using brute force? I have worked out how to do this up to repeating blocks of 100 or more, but I do not know if this is an unsolved problem in maths. Please reply in as plain English as you can.
    many thanks.
    Stephanie

  13. Alan Graham Robinson says:

    Stephanie, I am not sure I follow you properly. 1 / 89 is a rational number alright because it is a fraction; and I accept your word for it that as a decimal it has a repeating pattern 44 digits long. But I don’t understand what you mean about divisors. 89 is prime and therefore has no integer divisors.
    As far as I know, the only way to write 1 / 89 as a decimal is to do long division, but I am sure mathematicians have some other crafty if esoteric method at their disposal.

Leave a Reply

Your email address will not be published.