{"id":312,"date":"2017-01-13T21:29:55","date_gmt":"2017-01-13T21:29:55","guid":{"rendered":"http:\/\/perfectionatic.org\/?p=312"},"modified":"2017-03-28T20:50:17","modified_gmt":"2017-03-28T20:50:17","slug":"kaperkars-constant","status":"publish","type":"post","link":"https:\/\/perfectionatic.org\/?p=312","title":{"rendered":"Kaperkar&#8217;s Constant"},"content":{"rendered":"<p>I was recently introduced to <a href=\"https:\/\/www.youtube.com\/watch?v=d8TRcZklX_Q\">Kaperkar&#8217;s Constant<\/a>.<br \/>\nIt is quite magical. You take any four digit number \\(A\\), sort the digits from highest to lowest to create a new number \\(A^{\\text{high}}\\), sort the digits from lowest to highest to get \\(A^{\\text{low}}\\), and calculate and new number \\(A= A^{\\text{high}}- A^{\\text{low}}\\). You repeat this procedure enough times and you end up with \\(A=6174\\).<\/p>\n<p>I made a nifty implementation of that in Julia below.<\/p>\n<p>https:\/\/gist.github.com\/mbeltagy\/b27f5cc93346d5e0614c92ab696dfc31<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was recently introduced to Kaperkar&#8217;s Constant. It is quite magical. You take any four digit number \\(A\\), sort the digits from highest to lowest to create a new number \\(A^{\\text{high}}\\), sort the digits from lowest to highest to get \\(A^{\\text{low}}\\), and calculate and new number \\(A= A^{\\text{high}}- A^{\\text{low}}\\). You repeat this procedure enough times [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[74,73,62,71],"tags":[92],"class_list":["post-312","post","type-post","status-publish","format-standard","hentry","category-julia","category-julialang","category-math","category-programming","tag-julia"],"_links":{"self":[{"href":"https:\/\/perfectionatic.org\/index.php?rest_route=\/wp\/v2\/posts\/312","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/perfectionatic.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/perfectionatic.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/perfectionatic.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/perfectionatic.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=312"}],"version-history":[{"count":7,"href":"https:\/\/perfectionatic.org\/index.php?rest_route=\/wp\/v2\/posts\/312\/revisions"}],"predecessor-version":[{"id":319,"href":"https:\/\/perfectionatic.org\/index.php?rest_route=\/wp\/v2\/posts\/312\/revisions\/319"}],"wp:attachment":[{"href":"https:\/\/perfectionatic.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/perfectionatic.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/perfectionatic.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}