# What 3 Digits Are In The Units Period | What 3 Digits Are In The Units Period

Summary: When computing the unit period of the decimals of some rational number in fraction form, it is important to know what three digits repeat. This article will explore what digits appear in the units period, under certain conditions.

### 1. An Introduction to Unit Period

When a rational number \$frac{a}{b}\$ (where a and b are integers) is expressed in decimal form, there are three possibilities: the decimal terminates, the decimal is non-terminating and non-repeating (like \$pi\$), or the decimal is non-terminating but repeating. In the last case, the repeating part is called the repeating block or the units period. For example, the rational number \$frac{1}{7}\$ has a repeating block of 142857. But what if the number is more complicated?

We want to find out what digits appear in the units period of a rational number, but it’s difficult to give a formula or algorithm that works in all cases. Instead, we’ll look at specific cases with special properties.

For the following sections, we will assume that \$frac{a}{b}\$ is a simplified fraction (i.e., \$a\$ and \$b\$ have no common factors). We will also use the symbol \$pmod{m}\$, pronounced “mod m”, which means the remainder when dividing by m.

### 2. Units Period of 1/p

If \$p\$ is a prime number, then the repeating block of \$frac{1}{p}\$ has length \$p-1\$. For example, \$frac{1}{7}\$ has a repeating block of length 6 because 7 is prime and \$7-1=6\$. To see why this is true, consider the long division of 1 by \$p\$:

```    0 . 0 1
----------
p | 1 . 0 0 0 0 ...
- 7
-----
3
-
30
-
21
-
9
-
90
-
63
-
27
-
...
```

Each step of the long division involves subtracting a multiple of \$p\$, so the remainder must be less than \$p\$ and greater than or equal to 0. Since there are only \$p-1\$ integers between 0 and \$p-1\$, the remainder must eventually repeat. Once it repeats, the quotient (the digits before the decimal point) also repeats, so we have found the units period.

For example, when dividing 1 by 7, the remainders are 1, 3, 2, 6, 4, 5, and then it goes back to 1. Therefore, the units period is 142857 (the digits of the quotient).

If \$p\$ is not prime, the length of the repeating block is still finite but may be smaller than \$p-1\$. For example, \$frac{1}{10}\$ has a repeating block of length 1, even though 10 is not prime.

### 3. Units Period of Fractions with Powers of 10 in the Denominator

Suppose \$frac{a}{b}\$ has a prime factorization of \$b = 2^m 5^n c\$, where \$c\$ is relatively prime to 10 (i.e., \$c\$ has no factors of 2 or 5). Then the length of the repeating block is the maximum of \$m\$ and \$n\$. To see why, consider the example of \$frac{7}{500}\$:

```         0.014
-----
500 | 7.00000...
5
-----
20
15
--
50
50
--
0
```

The digit 7 in the numerator corresponds to a denominator of 10,000 (i.e., \$10^4\$), so we move the decimal point four places to get 0.0007. We divide 7 by 5 repeatedly to get the digits after the decimal point. Since \$2^m\$ contains more factors of 2 than \$5^n\$, we only need to consider the powers of 5.

The remainders when dividing powers of 5 by 500 are:

• \$5^1 equiv 5 pmod{500}\$
• \$5^2 equiv 25 pmod{500}\$
• \$5^3 equiv 125 pmod{500}\$
• \$5^4 equiv 375 pmod{500}\$
• \$5^5 equiv 125 pmod{500}\$ (repeats)

Therefore, the units period of \$frac{7}{500}\$ is 0014 followed by the repeating block 12. This has length 2, which is \$max{1,1}\$ (since \$2^m\$ and \$5^n\$ both equal 0).

This method works because \$10^k\$ has prime factorization \$2^k 5^k\$. The powers of 2 don’t matter since they just add zeros to the decimal, but the powers of 5 determine when the repeating block starts.

### 4. Units Period of Cyclic Fractions

A cyclic fraction is one whose digits repeat in a predictable pattern. For example, suppose we have the number \$0.overline{36}\$ (which means the digits 3 and 6 keep repeating). We can represent this as a fraction:

\$\$0.overline{36} = frac{36}{99}\$\$

The reason this works is because \$0.overline{36}\$ means 0.363636…, so if we subtract the original number from 100 times itself, we get:

```   99 . 0 0 0 0 ...
-   36 . 3 6 3 6 ...
-------------
63 . 6 3 6 3 ...
-  36 . 3 6 3 6 ...
--------------
27 . 3 0 3 0 ...
-  36 . 3 6 3 6 ...
--------------
- 9 . 9 6 9 6 ...
```

We end up with a repeating block of 3696, so \$frac{36}{99}\$ has a units period of 369. In general, if a cyclic fraction has \$k\$ digits that repeat, it corresponds to a fraction with denominator \$10^k – 1\$. For example, \$0.overline{136} = frac{136}{999}\$.

### 5. Non-Cyclic Fractions

Unfortunately, not all fractions fall into the previous categories, and finding the units period of a non-cyclic fraction can be extremely difficult. The general method is to start by writing the fraction in long division form and looking for patterns in the remainders.

For example, suppose we want to find the units period of \$frac{1}{33}\$:

```         0.03
-----
33 | 1.00000...
99
--
10
99
--
1
0
```

We have a repeating block after the first digit, but it’s not immediately clear what the length is because we get a remainder of 10 instead of 0. However, if we look at the remainders as we go along (0, 3, 9, 2, 6, 1), we notice that they repeat every 6 steps. Therefore, the units period is 03 followed by the repeating block 09 26 (or equivalently, 03 03 03… 09 26 09 26…).

### Conclusion:

Computing the units period of a decimal can be difficult, but for certain types of fractions, there are methods that can be used to find the repeating digits. For a prime number \$p\$, the units period of \$frac{1}{p}\$ has length \$p-1\$. If the denominator is a power of 10 times a number with no factors of 2 or 5, the length of the units period is the greater of the powers of 2 and 5. A cyclic fraction corresponds to a repeating block of \$k\$ digits, where \$k\$ is the length of the repeating block. For non-cyclic fractions, finding the units period involves looking for patterns in the remainders of long division. With these methods, we can determine what digits appear in the units period of a given rational number.