Sub topic 4
Prime Factorization as the Master Tool
Assume you know integer arithmetic, division with remainders, exponent notation, and basic algebraic manipulation. This chapter uses those skills to express numbers in a form that makes many CAT problems systematic.
What prime factorization means
A prime number has exactly two positive factors: 1 and itself. Examples include 2, 3, 5, 7, and 11. The number 1 is neither prime nor composite.
Prime factorization writes a positive integer as a product of prime numbers. For example:
\[ 360=2\times2\times2\times3\times3\times5=2^3\times3^2\times5 \]
The exponent tells you how many times that prime occurs. Every integer greater than 1 has one unique prime factorization, apart from the order of the factors.
How to factorize a number
Start with the smallest prime, 2. Divide repeatedly while the number remains divisible by 2. Then test 3, 5, 7, and so on. Stop when the remaining value is 1, or when the next possible prime is larger than the square root of the remaining value.
For 360:
\[ 360=2\times180=2^2\times90=2^3\times45 \]
Then:
\[ 45=3^2\times5 \]
Therefore:
\[ \boxed{360=2^3\times3^2\times5} \]
This exponent form is more useful than a long list because it exposes the structure of the number.
def factorize(n):
factors = {}
prime = 2
while prime * prime <= n:
while n % prime == 0:
factors[prime] = factors.get(prime, 0) + 1
n //= prime
prime += 1
if n > 1:
factors[n] = factors.get(n, 0) + 1
return factors
print(factorize(360)) # {2: 3, 3: 2, 5: 1}Why this is the master tool
Once a number is written as prime powers, its factors can be built by choosing an exponent for each prime:
\[ 360=2^3\times3^2\times5^1 \]
A factor of 360 must have the form:
\[ 2^a3^b5^c \]
where:
\[ 0\leq a\leq3,\quad 0\leq b\leq2,\quad 0\leq c\leq1 \]
This immediately supports later results:
- The number of factors is found by multiplying one more than each exponent.
- The sum of factors comes from geometric sums for each prime.
- The HCF uses the smaller exponent of each common prime.
- The LCM uses the larger exponent appearing in either number.
- A number is a perfect square when every exponent is even.
For example, if:
\[ 252=2^2\times3^2\times7 \]
and:
\[ 105=3\times5\times7 \]
then their HCF is:
\[ 3^1\times7^1=21 \]
Their LCM is:
\[ 2^2\times3^2\times5\times7=1260 \]
Exercise
Factorize 540 into prime powers, then find its HCF with 360.
Show answer
540 = 2^2 × 3^3 × 5 and 360 = 2^3 × 3^2 × 5, so the HCF is 2^2 × 3^2 × 5 = 180.