Techniques for Factoring Numbers in Your Head
exupero.org
exupero.org
To check 13, I might subtract off 2600 to get 147, then also 130 to get 17. Or I might have started by adding 13 to get 2760 and hence 276, then subtracted 260 or 26.
To check 17 subtract it once to get 2730 and hence 273. Then add it to get 290 and hence 29.
To check 19 subtract 1900 to get 847, then 38 to get 805. Divide by 5 to get 161, add 19, and we've pretty much gotten to "no".
For 23 add it to 2747 to get 2770 and 277, then substract 230 to get 47.
2900 - 2747 = 153, which can only be divisible by 29 if it equals 29 x 7 (because else the last digit wouldn't be 3), which it doesn't.
Similarly, 31 doesn't divide 353.
2747 - 37 = 2710, and now there's a special trick, because 37 divides 111. 271 - 111 = 136. 136 - 37 = 99, which 37 obviously doesn't divide.
At 41 I'll just do a size check. 41 x 57 is too small, and 57 isn't prime anyway. 41 * 77 also couldn't work. So it's 41 x 67 or bust. That's 2400 + 280 + 60 + 7 ... and we have a winner! 2747 = 41 x 67. Checking the multiplication, (40+1) x (70-3) = 2800 + 70 - 120 - 3, which indeed works out to 2747.
It's fixed or at least improved now.
Note that code blocks are painful to read on mobile so don't overuse it on text with ridiculously long lines.
I don't follow that one.
To check whether 2747 is divisible by 7, I divide the multiple of 100 (i.e. 2700) by 50 (i.e. 54), add it to the remaining two digits, 47 (i.e. 101), then see if that's divisible by 7.
If I'm checking for any prime other than 2 or 5 -- each of which has it own quick-check anyway via the last digit only -- it's always OK to drop trailing zeros.
The division by subtraction is fairly well known, of course, but it reminds me of the surprising square root by subtraction that I only learned about recently. It's probably too much to do mentally, but easy with pencil & paper.
To compute the digits of the square root of n, set a = 5n, b = 5. Repeat: if a≥b, set a=a-b, add 10 to b. Then if a<b, add two zeroes to a, and add a zero to b just before the final digit (which will always be ‘5’).
I had to code it up myself just to believe it would work. http://www.afjarvis.staff.shef.ac.uk/maths/jarvisspec02.pdf
I'm very not sure what it's doing, but it looks like a different algorithm to me; there are a surprising number of square root techniques. https://en.m.wikipedia.org/wiki/Methods_of_computing_square_...
100 is divisible by 2. 2x50=100
No need to wonder if 51-99 are factors. They aren't. 50 is your largest factor.
50 = 2x5x5 So 100 = 2x2x5x5
You can build your other factors of 4,10, 20 and 25 by multiplying the subsets.
I realised that the digits of multiples of 9 that are under 100 always add up to 9. I was surprised when I discovered that other students didn't notice this.
Others tables are easy: 10x (just add a 0), 5x (half of 10), 2x, 4x, 8x (keep multiplying by 2). That only leaves 3x, 6x, 7x, and 12x to memorise.
Now I have a calculator watch, I don't need to remember the times tables. But when I was younger, it was very important to my teachers. I wish methods like this were taught instead of "just memorise it".
Of course, it fails at 99. It wasn't until much later that I learnt that all multiples of 9 have the property of their digits adding up to multiples of 9 and that there exist proofs.
123: 1 + 2 + 3 = 6, 6 rem 3 == 0, so 123 is cleanly divisible by 3.
123456789: sum is 45, 4+5 is 9, 9 rem 3 == 0, so 123456789 is divisible by 3.
To know if a number less than 100 is a prime, you just need to remember that 7 x 13 = 91. This is the only number than seems like it might be prime, but isn't. All other composite numbers are multiples of 2, 3, 5 or 11 (easy to check quickly) or 49, widely known to be 7 x 7.
Secondly, if you are factoring large numbers, and you have quickly checked for division by 2, 3 and 5, you should then take the number modulo 1001. 1001 = 7 x 11 x 13, the next few primes, so you can use modulo 1001 to check for divisibility by all of these.
It's easy to reduce modulo 1001, similarly to reducing modulo 11. 1000 is -1 modulo 1001, 1000000 is 1 modulo 1001, etc. So 31,415,926,535,897 = 31 - 415 + 926 - 535 + 897 mod 1001
These two tidbits are numerical 'coincidences', but they're also related. Remember how 7 x 13 = 91? Well 1 / 11 = 0.0909090909... so 1000 / 11 = 90.9090.., just below 91, and repeating every two digits. Add one one-thousandth of itself and you get 90.9999999 = 91.
If b evenly divides a×r_i, where r_i is the current value, divide by b. If not, add or subtract p until the result is evenly divisible by b, then divide by b.
And step 6 should loop back to step 4 and define r_i to be the "result".
This method is very interesting and systematic, but it seems pretty complicated compared to ad hoc reasoning. E.g. 34 is a multiple of 17, so 680 must be too; 986-680 = 306, which is 34 away from 340, a multiple of 17, so 17 is a factor of 986.
And yes, this is more complex than basic reasoning. It's an optimization to the original algorithm, and like most optimized algorithms, is less transparent.
> can I factor the current time faster than he can fall asleep?
If your son falls asleep within 3 minutes, you might want to consider putting him to bed earlier, especially if his exhaustion is not based on lots of physical activity.
Why? Because he must be really tired if he falls asleep like that which might be an indication of sleep deprivation.
This part threw me for a bit until I realized that numbers that end in 5 can't be prime, other than 5 itself. And I don't really need a rule to test divisibility by 5.