{"id":418,"date":"2011-06-20T14:10:46","date_gmt":"2011-06-20T22:10:46","guid":{"rendered":"http:\/\/stevenrbrandt.com\/wordpress\/?p=418"},"modified":"2012-08-15T11:05:56","modified_gmt":"2012-08-15T19:05:56","slug":"ulam-spiral-fun","status":"publish","type":"post","link":"https:\/\/stevenrbrandt.com\/?p=418","title":{"rendered":"Ulam Spiral Fun"},"content":{"rendered":"<p>The Ulam Spiral is a famous cool thing. <a href='https:\/\/secure.wikimedia.org\/wikipedia\/en\/wiki\/Ulam_spiral'>See Wikipedia Entry.<\/a> Basically, Ulam put numbers on a square spiral <!--more--> and colored the prime numbers black.<\/p>\n<table  class=\"alignright\">\n<tr>\n<td><img decoding=\"async\" src=\"http:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/1\/1d\/Ulam_spiral_howto_all_numbers.svg\/200px-Ulam_spiral_howto_all_numbers.svg.png\" \/><\/td>\n<td>\n<img decoding=\"async\" src=\"http:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/6\/69\/Ulam_1.png\/220px-Ulam_1.png\"><\/td>\n<\/tr>\n<\/table>\n<p>One variant of it is to plot an <a href=\"https:\/\/secure.wikimedia.org\/wikipedia\/en\/wiki\/Archimedean_spiral\">Archemedean Spiral<\/a> instead, that is you let r = theta = some constant * sqrt(prime). Plot all the primes as black dots. If you pick 8*pi as your value for &#8220;some constant&#8221; you get this image:<\/p>\n<p><a href=\"http:\/\/stevenrbrandt.com\/wordpress\/wp-content\/uploads\/2011\/06\/Screenshot.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"419\" data-permalink=\"https:\/\/stevenrbrandt.com\/?attachment_id=419\" data-orig-file=\"https:\/\/stevenrbrandt.com\/wordpress\/wp-content\/uploads\/2011\/06\/Screenshot.png\" data-orig-size=\"1189,1145\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"UlamSpiralPi8\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/stevenrbrandt.com\/wordpress\/wp-content\/uploads\/2011\/06\/Screenshot-300x288.png\" data-large-file=\"https:\/\/stevenrbrandt.com\/wordpress\/wp-content\/uploads\/2011\/06\/Screenshot-1024x986.png\" src=\"http:\/\/stevenrbrandt.com\/wordpress\/wp-content\/uploads\/2011\/06\/Screenshot-300x288.png\" alt=\"Ulam Spiral, sort of\" title=\"UlamSpiralPi8\" width=\"300\" height=\"288\" class=\"alignright size-medium wp-image-419\" srcset=\"https:\/\/stevenrbrandt.com\/wordpress\/wp-content\/uploads\/2011\/06\/Screenshot-300x288.png 300w, https:\/\/stevenrbrandt.com\/wordpress\/wp-content\/uploads\/2011\/06\/Screenshot-1024x986.png 1024w, https:\/\/stevenrbrandt.com\/wordpress\/wp-content\/uploads\/2011\/06\/Screenshot.png 1189w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>It took some fiddling to find a good image. Pick the wrong constant and you just get a bunch of random dots. This particular plot shows a nice empty patch along the X-axis and it leads to the following conjecture:<\/p>\n<p>For any number p, let a = 8*pi*sqrt(p). If abs(a*sin(a)) < 10e-4 and a*cos(a) > 54, then p is not prime.<\/p>\n<p>I can&#8217;t prove this in general, but it&#8217;s true for the first million primes.<\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-418\" class=\"share-twitter sd-button share-icon\" href=\"https:\/\/stevenrbrandt.com\/?p=418&amp;share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\" ><span>Twitter<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-418\" class=\"share-facebook sd-button share-icon\" href=\"https:\/\/stevenrbrandt.com\/?p=418&amp;share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\" ><span>Facebook<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>The Ulam Spiral is a famous cool thing. See Wikipedia Entry. Basically, Ulam put numbers on a square spiral<\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-418\" class=\"share-twitter sd-button share-icon\" href=\"https:\/\/stevenrbrandt.com\/?p=418&amp;share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\" ><span>Twitter<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-418\" class=\"share-facebook sd-button share-icon\" href=\"https:\/\/stevenrbrandt.com\/?p=418&amp;share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\" ><span>Facebook<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[65],"tags":[75],"class_list":["post-418","post","type-post","status-publish","format-standard","hentry","category-computers","tag-computers"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pgWoS-6K","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/stevenrbrandt.com\/index.php?rest_route=\/wp\/v2\/posts\/418"}],"collection":[{"href":"https:\/\/stevenrbrandt.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stevenrbrandt.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stevenrbrandt.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/stevenrbrandt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=418"}],"version-history":[{"count":14,"href":"https:\/\/stevenrbrandt.com\/index.php?rest_route=\/wp\/v2\/posts\/418\/revisions"}],"predecessor-version":[{"id":704,"href":"https:\/\/stevenrbrandt.com\/index.php?rest_route=\/wp\/v2\/posts\/418\/revisions\/704"}],"wp:attachment":[{"href":"https:\/\/stevenrbrandt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stevenrbrandt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stevenrbrandt.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}