{"id":767,"date":"2012-12-13T13:58:09","date_gmt":"2012-12-13T18:58:09","guid":{"rendered":"http:\/\/www.xavignu.com\/?p=767"},"modified":"2012-12-13T14:11:56","modified_gmt":"2012-12-13T19:11:56","slug":"767","status":"publish","type":"post","link":"https:\/\/www.xavignu.com\/?p=767","title":{"rendered":"Project Euler problem 30"},"content":{"rendered":"<p>Below is the solution to problem 30 from <a href=\"http:\/\/projecteuler.net\/\" target=\"_blank\">Project Euler<\/a>. It&#8217;s written in <a href=\"http:\/\/www.python.org\/\" target=\"_blank\">Python<\/a>, a programming language I&#8217;m trying to learn.<br \/>\n<\/p>\n<p>[python]<br \/>\n#!\/usr\/bin\/env python<br \/>\n# Project Euler problem 30<\/p>\n<p>narc_sum = 0<br \/>\nfor number in range(100, 200000):<br \/>\n        # Transform the number into a string<br \/>\n        string = str(number)<br \/>\n        # Transform the string into a list<br \/>\n        lst = list(string)<br \/>\n        sum = 0<br \/>\n        for i in range(len(lst)):<br \/>\n                # Add the members of the list to the fifth power<br \/>\n                sum = sum + (int(lst[i])**5)<br \/>\n        if (number == sum):<br \/>\n                # Add all numbers and store in narc_sum value<br \/>\n                narc_sum = narc_sum + number<br \/>\n                print &quot;Sum is &quot;,narc_sum<\/p>\n<p>[\/python]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Below is the solution to problem 30 from Project Euler. It&#8217;s written in Python, a programming language I&#8217;m trying to learn. [python] #!\/usr\/bin\/env python # Project Euler problem 30 narc_sum = 0 for number in range(100, 200000): # Transform the number into a string string = str(number) # Transform the string into a list lst [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[62,63,3],"tags":[56,22,6,70],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/sTQgt-767","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts\/767"}],"collection":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=767"}],"version-history":[{"count":6,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts\/767\/revisions"}],"predecessor-version":[{"id":777,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts\/767\/revisions\/777"}],"wp:attachment":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=767"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=767"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=767"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}