{"id":764,"date":"2014-01-21T14:26:07","date_gmt":"2014-01-21T06:26:07","guid":{"rendered":"http:\/\/www.dr-mikes-math-games-for-kids.com\/blog\/?p=764"},"modified":"2024-02-16T21:12:10","modified_gmt":"2024-02-16T13:12:10","slug":"how-to-find-big-prime-numbers","status":"publish","type":"post","link":"https:\/\/www.dr-mikes-math-games-for-kids.com\/blog\/2014\/01\/how-to-find-big-prime-numbers\/","title":{"rendered":"How To Find Big Prime Numbers"},"content":{"rendered":"<p>The best way to find big prime numbers is to use a thing called &#8220;modular arithmetic&#8221; and another thing called &#8220;fermat&#8217;s theorem&#8221; &#8211; not the famous &#8220;Fermat&#8217;s Last Theorem&#8221; &#8211; Fermat&#8217;s theorem is much less famous and much more useful than Fermat&#8217;s Last Theorem.<\/p>\n<p><!--more--><br \/>\nModular arithmetic is when we do addition, subtraction and multiplication with the remainders of numbers instead of the number itself. So, if we choose a &#8216;base&#8217; of 10, we&#8217;d say 3 times 4 is 2. That&#8217;s because if you choose any numbers which end in 3 and 4 (that is, their remainders are 3 and 4 when you divide them by 10), and multiply them, you get a number whose last digit is 2.<\/p>\n<p>Try it: what&#8217;s the last digit of 33 x 184? of 103 x 1294? Of 239830903 x 29083498954? It&#8217;s always 2.<\/p>\n<p>If we use a base of 7 instead, we&#8217;d say 3 x 4 is 5. If I multiply two numbers which give remainders of 3 and 4 when I divide them by 7, the result will give a remainder of 5 when I divide it by 7.<\/p>\n<p>That&#8217;s modular arithmetic. Fermat&#8217;s theroem says that if your base is prime, say P, then whenever if I raise A to the power of P, I get A.<\/p>\n<p>Examples:<\/p>\n<p>if P is 3,<\/p>\n<ul>\n<li>\u00a01 x 1 x 1 is 1,<\/li>\n<li>\u00a02 x 2 x 2 is 8, which has a remainder of 2.<\/li>\n<\/ul>\n<p>if P is 7,<\/p>\n<ul>\n<li>\u00a01^7 is 1,<\/li>\n<li>\u00a02^7 is 128, which has a remainder of 2 when I divide by 7,<\/li>\n<li>\u00a03^7 is 2187, which has a remainder of 3 when I divide by 7,<\/li>\n<li>\u00a04^7 is 16384, which has a remainder of 4 when I divide by 7,<\/li>\n<li>\u00a05^7 is 78125, which has a remainder of 5 when I divide by 7,<\/li>\n<li>\u00a06^7 is 279936, which has a remainder of 6 when I divide by 7.<\/li>\n<\/ul>\n<p>On the other hand, if P is 10,<\/p>\n<ul>\n<li>Although 1^10 is 1, on the other hand<\/li>\n<li>\u00a02^10 is 1024, which has a remainder of 4, not 2, when I divide by 10.<\/li>\n<\/ul>\n<p>So if you have a big number N and you want to check if it&#8217;s prime, you can do this:<\/p>\n<ul>\n<li>\u00a0make sure N doesn&#8217;t have any small factors &#8211; if it does, it&#8217;s obviously not prime!<\/li>\n<li>\u00a0choose your favourite number A<\/li>\n<li>\u00a0work out A^N modulo N (that is, the remainder when you divide A^N by N &#8211; there are quick ways of doing this)<\/li>\n<li>\u00a0if you don&#8217;t get A, then N is not prime.<\/li>\n<li>if you do get A, then pick a different A and try again &#8211; unless you already know from theory that you&#8217;ve checked enough different A&#8217;s for your particular N.<\/li>\n<\/ul>\n<p>All big prime numbers now rely on tricks like this one &#8211; Fermat&#8217;s theorem, or the similar Lucas-Lehmer test.<\/p>\n<p>If you want to find a <a href=\"http:\/\/primes.utm.edu\/largest.html#biggest\" target=\"_blank\" rel=\"noopener\">record-breaking prime number<\/a>, it can take months of computer time to check a single number. Since most numbers are not prime, a solo hunter will need to spend centuries hunting. The holders of the records get the job done by recruiting thousands of volunteers to donate unused computer time, so that record-breaking prime numbers aree discovered roughtly once every year or two. Look up the GIMPS project, for example &#8211; they own all ten of the top ten biggest known prime numbers!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The best way to find big prime numbers is to use a thing called &#8220;modular arithmetic&#8221; and another thing called &#8220;fermat&#8217;s theorem&#8221; &#8211; not the famous &#8220;Fermat&#8217;s Last Theorem&#8221; &#8211; Fermat&#8217;s theorem is much less famous and much more useful than Fermat&#8217;s Last Theorem.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[81],"tags":[286,481,482,480],"_links":{"self":[{"href":"https:\/\/www.dr-mikes-math-games-for-kids.com\/blog\/wp-json\/wp\/v2\/posts\/764"}],"collection":[{"href":"https:\/\/www.dr-mikes-math-games-for-kids.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dr-mikes-math-games-for-kids.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dr-mikes-math-games-for-kids.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dr-mikes-math-games-for-kids.com\/blog\/wp-json\/wp\/v2\/comments?post=764"}],"version-history":[{"count":4,"href":"https:\/\/www.dr-mikes-math-games-for-kids.com\/blog\/wp-json\/wp\/v2\/posts\/764\/revisions"}],"predecessor-version":[{"id":1297,"href":"https:\/\/www.dr-mikes-math-games-for-kids.com\/blog\/wp-json\/wp\/v2\/posts\/764\/revisions\/1297"}],"wp:attachment":[{"href":"https:\/\/www.dr-mikes-math-games-for-kids.com\/blog\/wp-json\/wp\/v2\/media?parent=764"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dr-mikes-math-games-for-kids.com\/blog\/wp-json\/wp\/v2\/categories?post=764"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dr-mikes-math-games-for-kids.com\/blog\/wp-json\/wp\/v2\/tags?post=764"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}