
{"id":16004,"date":"2014-10-26T15:34:22","date_gmt":"2014-10-26T15:34:22","guid":{"rendered":"http:\/\/www.beautifulwork.org\/?p=16004"},"modified":"2014-10-26T15:34:22","modified_gmt":"2014-10-26T15:34:22","slug":"hacking-with-a-program-to-solve-project-euler-problem-4","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2014\/10\/26\/hacking-with-a-program-to-solve-project-euler-problem-4\/","title":{"rendered":"How to write a program to solve project Euler problem 4"},"content":{"rendered":"<pre>\n'''\nThis file is worked on from http:\/\/www.s-anand.net\/euler.html , Solution of Problem 4 \n\nA palindromic number reads the same both ways. The largest palindrome made from the product \nof two 2-digit numbers is 9009 = 91 x 99.\n\nFind the largest palindrome made from the product of two 3-digit numbers.\n\n'''\n\nn = 0\n\nfor a in xrange(999,100,-1):\n    for b in xrange(a,100,-1):\n        x = a * b\n        if ( x &gt; n ):\n            s = str( a * b )\n            if s == s[::-1]:\n                n = a * b\nprint n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&#8221;&#8217; This file is worked on from http:\/\/www.s-anand.net\/euler.html , Solution of Problem 4 A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 x 99. Find the largest palindrome made from the product of two 3-digit numbers. &#8221;&#8217; n = 0 for &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2014\/10\/26\/hacking-with-a-program-to-solve-project-euler-problem-4\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to write a program to solve project Euler problem 4&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,91,93],"tags":[1227],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/16004"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=16004"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/16004\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=16004"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=16004"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=16004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}