§ 91. Prime Factorization of a Composite Number
Any composite number can be decomposed into prime factors, that is, represented as a product of prime numbers. For example, to decompose 12 into prime factors means to represent this number as follows: 12 = 2 · 2 · 3.
Suppose it is required to decompose some composite number into prime factors, for example, 420. To do this, we find (using divisibility rules) the smallest prime number by which 420 is divisible; such a number is 2. Let us divide 420 by 2:
420: 2 = 210; hence, 420 = 210 · 2. (1)
Now we look for the smallest prime number by which the composite number 210 is divisible; such a number is 2. Let us divide 210 by 2:
210: 2 = 105, hence, 210 = 105 · 2.
Let us replace the number 210 in equation (1) with the product equal to it:
The smallest prime number by which the composite number 105 is divisible is 3. Let us divide 105 by 3:
105 : 3 = 35, hence, 105 = 35 · 3.
Let us replace the number 105 in equation (2) with the product equal to it:
The smallest prime number by which the composite number 35 is divisible is 5; dividing 35 by 5, we find 7; hence, 35 = 7 · 5. Replacing the number 35 in equation (3) with the product equal to it, 35 = 7 · 5, we obtain:
This is the required decomposition, since now all factors are prime numbers.
Since the product does not change when the order of the factors is changed, they can be written in any order; usually they are written from smaller to larger, that is, as follows:
The decomposition into prime factors is most conveniently written as follows:
| 420 | 2 |
| 210 | 2 |
| 105 | 3 |
| 35 | 5 |
| 7 | 7 |
| 1 |
that is, the given composite number is written and a vertical line is drawn to its right. To the right of the line, the smallest prime number by which the given composite number is divisible is placed, and the given number is divided by it. The digits of the quotient are written under the dividend. This quotient is treated in the same way as the given number. The operations are continued until the quotient becomes one. Then all the numbers standing to the right of the line will be the prime factors of the given number.
In the example considered, we each time looked for the smallest prime divisor of the obtained number; most often this is the most convenient method of decomposition, because the smaller the number, the easier it is to divide by it; moreover, for most small divisors, simple divisibility rules exist. However, the indicated path is not mandatory, and often the decomposition into prime factors can be more simply performed in a different order. Thus, in our same example, we immediately see that 420 is divisible by 10 = 2 · 5. Therefore, having performed the decomposition 42 = 2 · 21 = 2 · 3 · 7 (mentally), we can write 420 = 10 · 42 = 2 · 5 · 2 · 3 · 7 = 2 · 2 · 3 · 5 · 7.
If it is required, for example, to decompose the number 13000 into factors, we can immediately notice that 13000 = 13 · 1000, and since 13 is a prime number, it remains to decompose the number 1000 = 10 · 10 · 10 = 2 · 5 · 2 · 5 · 2 · 5 into prime factors, and we immediately obtain:
Let us take another example. Let us decompose 8874 into prime factors:
| 8874 | 2 |
| 4437 | 3 |
| 1479 | 3 |
| 493 | 17 |
| 29 | 29 |
| 1 |
Having reached the quotient 493, we have difficulty deciding by which number it is divisible. In such cases, we turn to the table of prime numbers (in the reference appendix). If a number that caused us difficulty is found in it, then it is divisible only by itself. The number 493 is not found in the table of prime numbers; hence, this number is composite, and therefore we try to divide it by prime numbers: 7, 11, 13, etc., until we reach a division without a remainder. It turns out that 493 is divisible by 17, and the quotient is 29. Now we can finish the decomposition.
From this example, it is seen that sometimes it is very difficult to perform the decomposition of a composite number, since during the decomposition we may encounter a large number, for which it is difficult to decide whether it is prime or composite; and if it is composite, it is not always easy to find its smallest prime divisor.