Warning: The magic method Slickr_Flickr_Plugin::__wakeup() must have public visibility in /home/kenbauer/public_kenscourses/tc101winter2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php on line 152

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101winter2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101winter2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101winter2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101winter2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101winter2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101winter2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101winter2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101winter2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101winter2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101winter2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101winter2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101winter2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101winter2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101winter2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101winter2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101winter2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831
{"id":8251,"date":"2015-03-28T11:50:33","date_gmt":"2015-03-28T17:50:33","guid":{"rendered":"https:\/\/tc1014.withknown.com\/2015\/wsq11---yo-soy-196"},"modified":"2015-03-28T11:50:33","modified_gmt":"2015-03-28T17:50:33","slug":"wsq11-yo-soy-196-2","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101winter2015\/2015\/wsq11-yo-soy-196-2\/","title":{"rendered":"WSQ11 – Yo soy 196"},"content":{"rendered":"
\n

#TC1014<\/a> #WSQ11<\/a> #awesome<\/a><\/strong><\/p>\n

this program recives two number values, a low number and a higher number, and check the numbers from the lower to the highest number reporting: the range of numbers analyzed, number of natural palindromes, number of non-lychrel numbers, the amount of lychrel numbers found and print the lychrel numbers found.<\/strong><\/p>\n

to start i created a function to invert the integers so i could compare them.<\/strong><\/p>\n

def reverse(a):<\/strong><\/p>\n

        a = str(a)<\/strong><\/p>\n

        a = a[::-1]<\/strong><\/p>\n

        a = int(a)<\/strong><\/p>\n

        return a<\/strong><\/p>\n

this turns 123 into “123” into “321” into 321.<\/strong><\/p>\n

a function to determine if a number is a natural palindrome.<\/strong><\/p>\n

def palin(a):<\/strong><\/p>\n

      a1 = a<\/strong><\/p>\n

      a2 = reverse(a)<\/strong><\/p>\n

      if a1 == a2:<\/strong><\/p>\n

          return 1<\/strong><\/p>\n

      else:<\/strong><\/p>\n

          return 0<\/strong><\/p>\n

and a function to add the numbers to their inverse until they become a palindrome or reach a set amount of tries.<\/strong><\/p>\n

def nopalin(a)<\/strong><\/p>\n

    c = 0<\/strong><\/p>\n

    while c < 30:<\/strong><\/p>\n

       a1 = a<\/strong><\/p>\n

       a2 = reverse(a1)<\/strong><\/p>\n

       a3 = a1+a2<\/strong><\/p>\n

       a4 = reverse(a3)<\/strong><\/p>\n

       if a3 == a4:<\/strong><\/p>\n

          return 1<\/strong><\/p>\n

          break<\/strong><\/p>\n

       if a3 != a4:<\/strong><\/p>\n

          a = a3<\/strong><\/p>\n

          c += 1<\/strong><\/p>\n

       if c >= 30:<\/strong><\/p>\n

           return 0<\/strong><\/p>\n

that will take a number, invert it and add them until it becomes a palindrome for 30 tries, if it does not becomes a palindrome before then it will count as a lychrel number. after those 3 functions all you need is arrange them and add counters an a print order for the lychrel number found.<\/strong><\/p>\n

 <\/p>\n

reference for the reverse function:<\/strong><\/p>\n

http:\/<\/wbr>\/<\/wbr>stackoverflow.com\/<\/wbr>questions\/<\/wbr>931092\/<\/wbr>reverse-a-string-in-python<\/a><\/strong><\/p>\n

my code in github:<\/strong><\/p>\n

https:\/<\/wbr>\/<\/wbr>github.com\/<\/wbr>nazare52\/<\/wbr>progra\/<\/wbr>blob\/<\/wbr>master\/<\/wbr>wsq11.py<\/a><\/strong><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"

#TC1014 #WSQ11 #awesomethis program recives two number values, a low number and a higher number, and check the numbers from the lower to the highest number reporting: the range of numbers analyzed, number of natural palindromes, number of non-… Continue reading →<\/span><\/a><\/p>\n","protected":false},"author":128,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3,25],"tags":[228,45,344],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/posts\/8251"}],"collection":[{"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/users\/128"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/comments?post=8251"}],"version-history":[{"count":1,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/posts\/8251\/revisions"}],"predecessor-version":[{"id":8252,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/posts\/8251\/revisions\/8252"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/media?parent=8251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/categories?post=8251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/tags?post=8251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}