What's the quickest way to factor 133 or a number with prime number other than 2,3, 5 (i.e. 7, 11, 13, 19, 23, etc)? Using brute force/trial and error takes a lot of time.
Trial and error is the way, but there are certain "streamlining" methods.
1) Rules of divisibility can tell you whether a number is divisible by a prime, without going all the way and trying to divide it:
A number is divisible by 2 if it ends with an even digit. Example: 342.
A number is divisible by 3 if the sum of its digits is divisible by 3. Example: 225: 2+2+5=9 is divisible by 3, so 225 is divisible by 3.
A number is divisible by 4 if last two digits form a number that is div by 4: Example: 344: 44 is div by 4, so 344 is divisible by 4.
A number is divisible by 5 if it ends with an a 5 or zero. Example: 345.
A number is divisible by 6 if it's divisible by 2 and 3 - see above.
A number is divisible by 7...if it's divisible by 7. Use know multiples of 7 to check this: your number 133 is 7 below 140, which is a known multiple of 7, so 133 is a multiple of 7.
A number is divisible by 8 if last three digits form a number that is div by 8: Example: 1720: 720 is div by 8, so 1720 (or 2720, or 23720) are all divisible by 8.
A number is divisible by 9 if the sum of its digits is divisible by 9. Example: 225: 2+2+5=9 is divisible by 9, so 225 is divisible by 9.
A number is divisible by 10 if it ends with an a zero. Example: 340.
So you can use the rules to just test whether there is any need to actually try and divide the number by a prime, before you go and actually do it (for example, before going out and realizing that 133/7 = 19.
2) When testing whether a number is prime or divisible by primes, it's enough to stop testing when you reach the nearest perfect square. For 133, the nearest perfect square is 121, which is the square of 11: therefore, you need to test only until 11 to see whether 133 is prime. If 133 is not divisible by any prime up to 11, inclusive, then 133 is prime itself, and there's no need to test any further. Try it with 131, or 149.
















