Comments for The Math Less Traveled
https://mathlesstraveled.com
Explorations in mathematical beauty
Wed, 19 Sep 2018 07:15:16 +0000
hourly
1 http://wordpress.com/
Comment on Quickly recognizing primes less than 100 by Joe
https://mathlesstraveled.com/2018/09/16/quickly-recognizing-primes-less-than-100/#comment-29194
Wed, 19 Sep 2018 07:15:16 +0000http://mathlesstraveled.com/?p=3731#comment-29194One final comment: if you first verify there is no factor of 13 or less, then capping b at 15 is sufficient to establish primality for every number up to 1000 with the sole exception of 901.
]]>
Comment on Quickly recognizing primes less than 100 by Joe
https://mathlesstraveled.com/2018/09/16/quickly-recognizing-primes-less-than-100/#comment-29190
Tue, 18 Sep 2018 16:00:38 +0000http://mathlesstraveled.com/?p=3731#comment-29190Another short cut is to use the fact that the difference of successive squares increases by 2 each time. So in the previous example, if 900 – 851 isn’t a square, you add 61, then 63, then 65, etc until you get a square or get over 324. That way you only have to memorize the first 18 squares, which you probably already know.
]]>
Comment on Quickly recognizing primes less than 100 by joe
https://mathlesstraveled.com/2018/09/16/quickly-recognizing-primes-less-than-100/#comment-29187
Tue, 18 Sep 2018 14:43:43 +0000http://mathlesstraveled.com/?p=3731#comment-29187Take 851 as an example. You don’t need to successively add 1, 4, 9, 16, … and see whether you have a square each time. Rather you can subtract it from 900, 961, 1024, … and see whether that is a square. (The first one you try is.) Further, this sequence terminates quickly as you have tried direct division up to 13, so if it is composite a-b must be at least 17. This no longer happens after a is 34, so you settle primality with at most five subtractions.
The two methods complement each other because direct division works quickly if there is a small factor, and difference of two squares works well when the two factors are close together. There are very few composite numbers under 1000, which aren’t one or the other, and none at all if you divide up to 13, and then check a^2 – b^2 for b up to 18.
]]>
Comment on Quickly recognizing primes less than 100 by Brent
https://mathlesstraveled.com/2018/09/16/quickly-recognizing-primes-less-than-100/#comment-29186
Tue, 18 Sep 2018 11:00:55 +0000http://mathlesstraveled.com/?p=3731#comment-29186Interesting! Can you explain the short cuts you refer to (or give a link to some explanation)?
]]>
Comment on Quickly recognizing primes less than 100 by Joe
https://mathlesstraveled.com/2018/09/16/quickly-recognizing-primes-less-than-100/#comment-29185
Tue, 18 Sep 2018 05:37:03 +0000http://mathlesstraveled.com/?p=3731#comment-29185If you make that b <= 18, then all numbers up to 1000 are checked by applying those two procedures. There are some short cuts in checking whether it’s of the form a^2 – b^2, so it can be done quite quickly (and memorizing squares is easier and a lot more useful than memorizing the factors of numbers like 851).
]]>
Comment on Quickly recognizing primes less than 100 by Joe
https://mathlesstraveled.com/2018/09/16/quickly-recognizing-primes-less-than-100/#comment-29184
Tue, 18 Sep 2018 04:19:31 +0000http://mathlesstraveled.com/?p=3731#comment-29184A composite approach may work best. Check for factors up to, say, 13, and also check a^2 – b^2 for small b, say up to 13. This would give you every number up to 799 (47×17), with no memorization needed, other than squares.
]]>
Comment on Quickly recognizing primes less than 100 by Joe
https://mathlesstraveled.com/2018/09/16/quickly-recognizing-primes-less-than-100/#comment-29183
Tue, 18 Sep 2018 03:58:58 +0000http://mathlesstraveled.com/?p=3731#comment-29183851 = 900 – 49 = (30+7)(30-7)
]]>
Comment on Quickly recognizing primes less than 100 by Mark Dominus
https://mathlesstraveled.com/2018/09/16/quickly-recognizing-primes-less-than-100/#comment-29181
Mon, 17 Sep 2018 17:23:32 +0000http://mathlesstraveled.com/?p=3731#comment-29181I did recently post [an article about testing for divisibility by 7](https://blog.plover.com//math/divisibility-by-7.html). I have a followup in the works with additional tricks, but testing for divisibility by 7 is pretty easy and is not the issue with mental identification of primes under 1000. The problem is with numbers like 851.
]]>
Comment on Quickly recognizing primes less than 100 by j2kun
https://mathlesstraveled.com/2018/09/16/quickly-recognizing-primes-less-than-100/#comment-29180
Mon, 17 Sep 2018 17:21:39 +0000http://mathlesstraveled.com/?p=3731#comment-29180Surely! Shoot me an email at mathintersectprogramming@gmail.com
]]>
Comment on Quickly recognizing primes less than 100 by Brent
https://mathlesstraveled.com/2018/09/16/quickly-recognizing-primes-less-than-100/#comment-29179
Mon, 17 Sep 2018 16:33:09 +0000http://mathlesstraveled.com/?p=3731#comment-29179Yes, this is exactly the sort of thing I had in mind, though at this point I hadn’t got much farther than thinking there should be a way to pick some features and run an algorithm to build small decision trees. A straightforward approach is to run through divisibility tests up to 13 and then memorize the ~25 remaining composites which are products of primes >= 17; I’m curious to see whether we can come up with something better using an approach like what you outline. Would you be interested in collaborating on this? I’m not very familiar with machine learning techniques beyond the basics.
]]>