Applications of Prime Factorization

The number 36 is a perfect square. Its prime-factored form is \({2^2} \times {3^2}\). The powers of the both the prime factors are even. Consider 324. This is again a perfect square – its prime factored form is \({2^2} \times {3^4}\) – again, the powers of the prime factors are even.

It is easy to see that in any perfect square, the powers of all the prime-factors must be even, because when we take the square-root, we have to halve the power of each prime factor. If the power of a prime factor is not even, then it cannot be halved into an integer, and thus the corresponding number will not be a perfect square.

Similarly, if a number p is a perfect kth power, then the power of each prime factor must be a multiple of k, otherwise taking the kth root of p will not give an integer.

Example 1: Find the smallest positive integernsuch thatn/2 is a perfect square,n/3 is a perfect cube and n/5 is a perfect fifth power.

p must be a multiple of 3 and 5, and \(p - 1\) should be even. The minimum such p is 15.

q must be even and a multiple of 5, and \(q - 1\) must be a multiple of 3. The minimum such q is 10.

r must be even and a multiple of 3, and \(r - 1\) must be a multiple of 5. The minimum such r is 6.

Thus, \(n = {2^{15}}{3^{10}}{5^6}\) is the required number.

Consider the number n = 72. Can we somehow count the number of factors of this number, without listing them out explicitly?

The prime factored form of n is:

\[n = {2^3} \times {3^2}\]

Now, any factor of 72 can be formed by selecting a certain number of 2’s and a certain number of 3’s. For example:

If we select two 2’s and one 3, we get the factor \({2^2} \times 3\) or 12

If we select zero 2’s and two 3’s, we get the factor \({2^0} \times {3^2}\) or 9

If we select three 2’s and zero 3’s, we get the factor \({2^3} \times {3^0}\) or 8

…and so on

Note that we cannot take more than three 2’s, and more than two 3’s.

We see that any factor of 72 can be created by selecting a certain number of 2’s and a certain number of 3’s (subject to the constraint that the number of 2’s is from the set {0, 1, 2, 3}, while the number of 3’s is from the set is {0, 1, 2}). In how many ways can we do this?

This has essentially boiled down to a combinatorics problem. The number of ways of selecting 2’s is 4: we select either zero 2’s, one 2, two 2’s or three 2’s. The number of ways of selecting 3’s is 3: we select either zero 3’s, one three or two 3’s.

Using the FPC, the number of ways of selecting a certain number of 2’s and 3’s must be \(4 \times 3 = 12\). Thus, 72 should have 12 factors. Let us verify this explicitly:

\[1,2,3,4,6,8,9,12,18,24,36,72\]

What we’ve just discussed is significant in its elegance, so take a moment to understand it carefully.

Let us count the number of factors of 360, which can be prime-factored as:

\[360 = {2^3} \times {3^2} \times {5^1}\]

To form a factor of 360, we need:

a certain number of 2’s (from a minimum of 0 to a maximum of 3) – thus, the number of ways of selecting 2’s is 3 + 1 or 4

a certain number of 3’s (from a minimum of 0 to a maximum of 2) – this means that the number of ways of selecting 3’s is 2 + 1 or 3

a certain number of 5’s (either 0 or 1) – which means that the number of ways of selecting 5’s is 2

Thus, the number of ways to form a factor of 360 is \(4 \times 3 \times 2\) or 24. In other words, 360 has 24 factors. You can verify this explicitly if you want to.

Example 2: How many factors does 1000 have?

Solution:. We note that \(1000 = {2^3} \times {5^3}\), and so the number of factors of 1000 is \(\left( {3 + 1} \right)\left( {3 + 1} \right) = 16\).

Example 4:The 100-switches problem: In a long corridor, there are 100 switches in a row, numbered 1 to 100. Initially, all of them are in the off mode. Let us label one end of the corridor as A, and the other end as B. Flipping a switch is changing its state: if the switch is off, flipping it is changing it to on, and vice-versa. Now, the following sequence of events takes place:

When is this number odd? Clearly, when all the \({k_i}'{\rm{s}}\) are even, which would imply n being a perfect square (as discussed earlier).

Thus, all the perfect-square numbered switches will be in the on mode: 1, 4, 9, 16, 25, 36, 49, 64, 81, 100.

Now, we consider another problem on factors. Can you find the sum of all the factors of 72, without explicit addition of all the factors?

We saw a technique of counting the number of factors of any number using its prime-factored form, without explicit counting. Can we do something similar for the sum of the factors?

The prime-factored form of 72 is \({2^3} \times {3^2}\). Any factor of 72 is of the form \({2^i} \times {3^j}\), where i is from the set {0, 1, 2, 3}, and j is from the set {0, 1, 2}. We need to find the sum of all such numbers of the form \({2^i} \times {3^j}\), give the specified constraints.

When we expand this product, any term will be of the form \({2^i} \times {3^j}\) satisfying the desired constraints for i and j, and S will be the sum of all such terms! Thus, S is the required sum of all the factors:

\[S = 15 \times 13 = 195\]

Take another example: \(n = 450\). Let us calculate the sum of all the factors of n. The prime-factored form of n is:

\[n = {2^1} \times {3^2} \times {5^2}\]

We need to find the sum of all terms of the form \({2^i}{3^j}{5^k}\), where i is in {0, 1}, j is in {0, 1, 2}, and k is in {0, 1, 2}. We consider the following expression:

You are now asked this question: at the end of the number 50!, how many 0’s are there? We note that 50! has 47 2’s and 12 5’s. A pair of 2 and 5 will form a 10, and contribute a 0. Since there are only 12 5’s, the number of 0’s contributed will 12. Thus, there will be 12 0’s at the end of 50!.