{"id":287,"date":"2019-06-26T23:24:11","date_gmt":"2019-06-26T23:24:11","guid":{"rendered":"http:\/\/funfacts.104.42.120.246.xip.io\/?page_id=287"},"modified":"2020-01-03T23:45:26","modified_gmt":"2020-01-03T23:45:26","slug":"wilsons-theorem","status":"publish","type":"page","link":"https:\/\/math.hmc.edu\/funfacts\/wilsons-theorem\/","title":{"rendered":"Wilson&#8217;s Theorem"},"content":{"rendered":"\n<p>Here&#8217;s an interesting characterization of primes:<\/p>\n\n\n\n<p>Wilson&#8217;s Theorem. A number P is prime if and only if<\/p>\n\n\n\n<p style=\"text-align:center\">(P-1)! + 1 is divisible by P.<\/p>\n\n\n\n<p>Let&#8217;s check:&nbsp;<br>(2-1)!+1 = 2, which is divisible by 2.&nbsp;<br>(5-1)!+1 = 25, which is divisible by 5.&nbsp;<br>(9-1)!+1 = 40321, which is not divisible by 9 (cast out nines to see this).<\/p>\n\n\n\n<p>Pretty cool!<\/p>\n\n\n\n<p><strong>The&nbsp;Math&nbsp;Behind&nbsp;the&nbsp;Fact:<\/strong><br>However it is not really practical to use this to test if a number is prime, especially if P is large: just try P=101, and you&#8217;ll see what I mean! There are better primality tests available; you can learn about some of them in a&nbsp;number theory&nbsp;class. See also&nbsp;Fermat&#8217;s Little Theorem.<\/p>\n\n\n\n<p><strong>How to Cite this Page:<\/strong>&nbsp;<br>Su, Francis E., et al. &#8220;Wilson&#8217;s Theorem.&#8221;&nbsp;<em>Math Fun Facts<\/em>. &lt;http:\/\/www.math.hmc.edu\/funfacts&gt;.<\/p>\n\n\n\n<p><strong>Fun Fact suggested by: &nbsp;<\/strong> <br>Jorge Aarao&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s an interesting characterization of primes: Wilson&#8217;s Theorem. A number P is prime if and only if (P-1)! + 1&#46;&#46;&#46;<\/p>\n","protected":false},"author":7,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"tags":[3,10,103,49],"class_list":["post-287","page","type-page","status-publish","hentry","tag-easy","tag-numtheory","tag-primality-test","tag-prime"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/pages\/287","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/comments?post=287"}],"version-history":[{"count":4,"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/pages\/287\/revisions"}],"predecessor-version":[{"id":1705,"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/pages\/287\/revisions\/1705"}],"wp:attachment":[{"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/media?parent=287"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/math.hmc.edu\/funfacts\/wp-json\/wp\/v2\/tags?post=287"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}