Thanks for asking! This is a really interesting method of approaching this problem.
Let's remember the question: We want to find a number smaller than 30 with the most factors.
In the beginning of the video, Prof. Loh is trying to analyze the relationship between the number of factors of a number and the kinds of prime factors that make it up. That's why he only tests a few numbers:
17 (a big prime)
12 (a number made up of small primes)
28 (a number with not-as-small primes)
24 (a number close in size to 28 with smaller primes)
12 = 3 × 2² → 6 factors
28 = 7 × 2² → 6 factors
Wait; 12 and 28 have the same number of factors, but they are about the same size! Why is this? It's because the primes in 12 (2 and 3) are small, but 28 has a larger prime (7).
17 = 17 → 2 factors
And 17 is bigger than 12, but it only has 2 factors! Why is this? It's because it is a large prime number, which can't be "broken down" into any other numbers. This tells us that maybe we should steer clear away from numbers with large prime factors.
We didn't have to try all possible numbers because we can use number sense to go for numbers composed of small primes.
Think about it: a 7 is worth as much as almost three 2's, since 2 × 2 × 2 = 8, which is close to 7. But the 2 × 2 × 2 will give us four choices for the number of 2's in the prime factorization of our number, which multiplies 4 to the number of factors. The 7 only will multiply the number of factors by 2 by comparison.
Math is neat because we can use intuition and number sense to guide us to make educated guesses. Then, when someone asks you for a five-digit number with the most factors, instead of trying out thousands of numbers, you'll be able to use these tricks to solve it, and it will take only a few minutes rather than a few hours!
Happy Learning,
The Daily Challenge Team