{"id":1900,"date":"2018-01-22T23:48:11","date_gmt":"2018-01-22T23:48:11","guid":{"rendered":"http:\/\/hauweele.net\/~gawen\/blog\/?p=1900"},"modified":"2018-01-22T23:50:47","modified_gmt":"2018-01-22T23:50:47","slug":"is-there-a-prime-number-whose","status":"publish","type":"post","link":"https:\/\/hauweele.net\/~gawen\/blog\/?p=1900","title":{"rendered":"Is there a prime number whose&#8230;"},"content":{"rendered":"<p><a href=\"https:\/\/www.reddit.com\/r\/math\/comments\/7qpfls\/does_there_exist_a_prime_number_whose\">Is there a prime number whose binary representation looks like a giraffe?<\/a><\/p>\n<div id=\"attachment_1901\" style=\"width: 138px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/hauweele.net\/~gawen\/blog\/wp-content\/uploads\/2018\/01\/prime-giraffe.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1901\" class=\"wp-image-1901 size-full\" src=\"https:\/\/hauweele.net\/~gawen\/blog\/wp-content\/uploads\/2018\/01\/prime-giraffe.png\" alt=\"\" width=\"128\" height=\"128\" \/><\/a><p id=\"caption-attachment-1901\" class=\"wp-caption-text\">Yes!<\/p><\/div>\n<p>like another prime number?<\/p>\n<div id=\"attachment_1902\" style=\"width: 81px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/hauweele.net\/~gawen\/blog\/wp-content\/uploads\/2018\/01\/prime-2.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1902\" class=\"wp-image-1902 \" src=\"https:\/\/hauweele.net\/~gawen\/blog\/wp-content\/uploads\/2018\/01\/prime-2.png\" alt=\"\" width=\"71\" height=\"71\" \/><\/a><p id=\"caption-attachment-1902\" class=\"wp-caption-text\">Yes!<\/p><\/div>\n<p>like a prime number of giraffes?<\/p>\n<div id=\"attachment_1904\" style=\"width: 138px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/hauweele.net\/~gawen\/blog\/wp-content\/uploads\/2018\/01\/prime-2giraffes.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1904\" class=\"wp-image-1904 size-full\" src=\"https:\/\/hauweele.net\/~gawen\/blog\/wp-content\/uploads\/2018\/01\/prime-2giraffes.png\" alt=\"\" width=\"128\" height=\"128\" \/><\/a><p id=\"caption-attachment-1904\" class=\"wp-caption-text\">YES!<\/p><\/div>\n<p>like Squidward Tentacles?<\/p>\n<div id=\"attachment_1911\" style=\"width: 138px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/hauweele.net\/~gawen\/blog\/wp-content\/uploads\/2018\/01\/prime-squidward.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1911\" class=\"wp-image-1911 size-full\" src=\"https:\/\/hauweele.net\/~gawen\/blog\/wp-content\/uploads\/2018\/01\/prime-squidward.png\" alt=\"\" width=\"128\" height=\"128\" \/><\/a><p id=\"caption-attachment-1911\" class=\"wp-caption-text\">Heck Yeah!<\/p><\/div>\n<p>You&#8217;ve probably understood the mechanism by now. Converting a binary image into a number, its nearest upper prime generally only differ in the lesser significant bits, hence most of the image pattern stays the same. So finding a prime number whose binary representation looks like a specific image is relatively easy. I say relatively, because in a computer sens it is quite really complex.<\/p>\n<p>I just wrote a <a href=\"http:\/\/github.com\/gawen947\/primg\">program to do just that<\/a>. It is written in C and uses <a>GMP<\/a>. It is around 1k SLOC. It could probably have been much shorter, and even less so in another language. But I wanted something that went a little further than just of simple proof of concept.<\/p>\n<p>I must admit, it&#8217;s pretty useless. But still there it is. And there is still much room for improvement. So patches are welcome on <a href=\"http:\/\/github.com\/gawen947\/primg\">GitHub<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Is there a prime number whose binary representation looks like a giraffe? like another prime number? like a prime number of giraffes? like Squidward Tentacles? You&#8217;ve probably understood the mechanism by now. Converting a binary image into a number, its &hellip; <a href=\"https:\/\/hauweele.net\/~gawen\/blog\/?p=1900\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[791,372,945,944,946,942,947,943,711],"class_list":["post-1900","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-binary","tag-c","tag-gmp","tag-image","tag-number","tag-prime","tag-prime-number","tag-program","tag-representation"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1900","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1900"}],"version-history":[{"count":0,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1900\/revisions"}],"wp:attachment":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1900"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1900"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1900"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}