<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Largest Palindromic Number In Python</title>
	<atom:link href="http://pthree.org/2007/09/15/largest-palindromic-number-in-python/feed/" rel="self" type="application/rss+xml" />
	<link>http://pthree.org/2007/09/15/largest-palindromic-number-in-python/</link>
	<description>Linux.  GNU.  Freedom.</description>
	<lastBuildDate>Fri, 17 May 2013 20:46:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.6-beta2-24176</generator>
	<item>
		<title>By: Nicholas</title>
		<link>http://pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-116874</link>
		<dc:creator>Nicholas</dc:creator>
		<pubDate>Fri, 31 Aug 2012 16:14:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-116874</guid>
		<description><![CDATA[Another thing to remember: If you want a number that starts with 9, and it&#039;s a palindrome, you should only try numbers that can come out with 9&#039;s if you follow a multiplication table. That means only try with the following sets in the last slot: {1,9},{3,3},{7,7}
If that doesn&#039;t work, you&#039;ll need to do the same thing with 8s and stop incrementing as soon as the result goes over 900,000, and so on in that order until all humans are eaten.]]></description>
		<content:encoded><![CDATA[<p>Another thing to remember: If you want a number that starts with 9, and it&#8217;s a palindrome, you should only try numbers that can come out with 9&#8242;s if you follow a multiplication table. That means only try with the following sets in the last slot: {1,9},{3,3},{7,7}<br />
If that doesn&#8217;t work, you&#8217;ll need to do the same thing with 8s and stop incrementing as soon as the result goes over 900,000, and so on in that order until all humans are eaten.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vince</title>
		<link>http://pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-109856</link>
		<dc:creator>vince</dc:creator>
		<pubDate>Mon, 16 Mar 2009 19:47:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-109856</guid>
		<description><![CDATA[actually, you only perform 900 * 900]]></description>
		<content:encoded><![CDATA[<p>actually, you only perform 900 * 900</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vince</title>
		<link>http://pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-109855</link>
		<dc:creator>vince</dc:creator>
		<pubDate>Mon, 16 Mar 2009 19:46:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-109855</guid>
		<description><![CDATA[Actually, you only perform 900 * 900 my mistake.]]></description>
		<content:encoded><![CDATA[<p>Actually, you only perform 900 * 900 my mistake.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vince</title>
		<link>http://pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-109854</link>
		<dc:creator>vince</dc:creator>
		<pubDate>Mon, 16 Mar 2009 19:45:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-109854</guid>
		<description><![CDATA[999 * 999 = 998001 iterations through every number, but I will be testing each one at least twice, so I only need to test half.

This point is an error if you consider the first one where you only go until 100.

Following your first point, means that you only do 999 * 900 iterations as opposed to 999 * 999. Why? you stop at 100. This means that you don&#039;t consider 999 * 99, 999 * 98, and so on.

Remember: the number of digits from 100 to 999 = (999 - 100) + 1 = 900.]]></description>
		<content:encoded><![CDATA[<p>999 * 999 = 998001 iterations through every number, but I will be testing each one at least twice, so I only need to test half.</p>
<p>This point is an error if you consider the first one where you only go until 100.</p>
<p>Following your first point, means that you only do 999 * 900 iterations as opposed to 999 * 999. Why? you stop at 100. This means that you don&#8217;t consider 999 * 99, 999 * 98, and so on.</p>
<p>Remember: the number of digits from 100 to 999 = (999 &#8211; 100) + 1 = 900.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: leed</title>
		<link>http://pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-108855</link>
		<dc:creator>leed</dc:creator>
		<pubDate>Sun, 26 Oct 2008 09:29:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-108855</guid>
		<description><![CDATA[I think follow code is the fastest I have tried.
maxnum = 0
for i in range(990, 99, -11):
	for j in range(999, i, -1):
		num = i * j
		if num &lt;= maxnum:
			break
		else:
			strnum = str(num)
			if strnum == strnum[::-1]:
				maxnum = num
				break
print maxnum]]></description>
		<content:encoded><![CDATA[<p>I think follow code is the fastest I have tried.<br />
maxnum = 0<br />
for i in range(990, 99, -11):<br />
	for j in range(999, i, -1):<br />
		num = i * j<br />
		if num &lt;= maxnum:<br />
			break<br />
		else:<br />
			strnum = str(num)<br />
			if strnum == strnum[::-1]:<br />
				maxnum = num<br />
				break<br />
print maxnum</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: i dont know</title>
		<link>http://pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-107970</link>
		<dc:creator>i dont know</dc:creator>
		<pubDate>Thu, 11 Sep 2008 15:50:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-107970</guid>
		<description><![CDATA[what&#039;s are biggest 2 3-dgits palindrome?]]></description>
		<content:encoded><![CDATA[<p>what&#8217;s are biggest 2 3-dgits palindrome?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Athropos</title>
		<link>http://pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-69317</link>
		<dc:creator>Athropos</dc:creator>
		<pubDate>Sun, 16 Sep 2007 12:52:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-69317</guid>
		<description><![CDATA[You should use the timeit module when you need to time something. It&#039;s better than using the time command because you then don&#039;t measure the startup time of the Python interpreter which can be a big part of the total time.

&lt;code&gt;
import timeit

...

t1 = timeit.Timer(&#039;palindrome()&#039;, &#039;from __main__ import palindrome&#039;)
print t1.timeit(20)
&lt;/code&gt;]]></description>
		<content:encoded><![CDATA[<p>You should use the timeit module when you need to time something. It&#8217;s better than using the time command because you then don&#8217;t measure the startup time of the Python interpreter which can be a big part of the total time.</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">import timeit<br />
<br />
...<br />
<br />
t1 = timeit.Timer('palindrome()', 'from __main__ import palindrome')<br />
print t1.timeit(20)</div></td></tr></tbody></table></div>
]]></content:encoded>
	</item>
	<item>
		<title>By: phoenyx</title>
		<link>http://pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-69305</link>
		<dc:creator>phoenyx</dc:creator>
		<pubDate>Sun, 16 Sep 2007 09:13:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-69305</guid>
		<description><![CDATA[FYI, it&#039;s considered bad form to post answers to problems outside of the forum.]]></description>
		<content:encoded><![CDATA[<p>FYI, it&#8217;s considered bad form to post answers to problems outside of the forum.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Duccio</title>
		<link>http://pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-69298</link>
		<dc:creator>Duccio</dc:creator>
		<pubDate>Sun, 16 Sep 2007 07:38:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-69298</guid>
		<description><![CDATA[Good post...only a doubt.
When you reach the column of the table of multiple of 11 (990,979,etc.) i think you must multiplicate this number for all the numbers smaller than this, and not only for multiple of 11 smaller than this. For example I don&#039;t see 990*989,990*988,etc. that are multiple of 11 too. Don&#039;t you think?]]></description>
		<content:encoded><![CDATA[<p>Good post&#8230;only a doubt.<br />
When you reach the column of the table of multiple of 11 (990,979,etc.) i think you must multiplicate this number for all the numbers smaller than this, and not only for multiple of 11 smaller than this. For example I don&#8217;t see 990*989,990*988,etc. that are multiple of 11 too. Don&#8217;t you think?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron</title>
		<link>http://pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-69283</link>
		<dc:creator>Aaron</dc:creator>
		<pubDate>Sun, 16 Sep 2007 02:56:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-69283</guid>
		<description><![CDATA[@Peter-  Ahh, yes.  Good call.  I&#039;ve updated my post to reflect the change.

@Seth-  No problem.  Let me know how far you get. :)]]></description>
		<content:encoded><![CDATA[<p>@Peter-  Ahh, yes.  Good call.  I&#8217;ve updated my post to reflect the change.</p>
<p>@Seth-  No problem.  Let me know how far you get. <img src='http://pthree.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Seth</title>
		<link>http://pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-69279</link>
		<dc:creator>Seth</dc:creator>
		<pubDate>Sun, 16 Sep 2007 02:23:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-69279</guid>
		<description><![CDATA[Never seen Project Euler before. Thanks for posting about it. :-)]]></description>
		<content:encoded><![CDATA[<p>Never seen Project Euler before. Thanks for posting about it. <img src='http://pthree.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-69277</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Sun, 16 Sep 2007 02:06:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-69277</guid>
		<description><![CDATA[A few thoughts:

- 5 digit palindromes are not necessarily divisible by 11, though that doesn&#039;t matter too much here as we&#039;re looking for 6 digit ones
abcba = 10001a + 1010b + 100c

- quick one liner (takes a few seconds here)
&lt;code&gt;max([x*y for x in range(100,1000) for y in range(100,1000) if str(x*y)==str(x*y)[::-1]])
&lt;/code&gt;]]></description>
		<content:encoded><![CDATA[<p>A few thoughts:</p>
<p>- 5 digit palindromes are not necessarily divisible by 11, though that doesn&#8217;t matter too much here as we&#8217;re looking for 6 digit ones<br />
abcba = 10001a + 1010b + 100c</p>
<p>- quick one liner (takes a few seconds here)</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">max([x*y for x in range(100,1000) for y in range(100,1000) if str(x*y)==str(x*y)[::-1]])</div></td></tr></tbody></table></div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin</title>
		<link>http://pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-69256</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Sat, 15 Sep 2007 23:19:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.pthree.org/2007/09/15/largest-palindromic-number-in-python/#comment-69256</guid>
		<description><![CDATA[&lt;code&gt;
def is_palin(num):
    s = str(num)
    return s == s[::-1]
&lt;/code&gt;]]></description>
		<content:encoded><![CDATA[<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">def is_palin(num):<br />
&nbsp; &nbsp; s = str(num)<br />
&nbsp; &nbsp; return s == s[::-1]</div></td></tr></tbody></table></div>
]]></content:encoded>
	</item>
</channel>
</rss>
