<?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/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:rawvoice="http://www.rawvoice.com/rawvoiceRssModule/"
	>
<channel>
	<title>Comments on: I think my brain just exploded</title>
	<atom:link href="http://enfranchisedmind.com/blog/posts/i-think-my-brain-just-exploded/feed/" rel="self" type="application/rss+xml" />
	<link>http://enfranchisedmind.com/blog/posts/i-think-my-brain-just-exploded/</link>
	<description>programming, politics, &#38; other religious issues</description>
	<lastBuildDate>Wed, 08 Feb 2012 14:16:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: Muji</title>
		<link>http://enfranchisedmind.com/blog/posts/i-think-my-brain-just-exploded/#comment-37720</link>
		<dc:creator>Muji</dc:creator>
		<pubDate>Sun, 25 Jul 2010 14:40:56 +0000</pubDate>
		<guid isPermaLink="false">http://enfranchisedmind.com/blog/2007/12/28/i-think-my-brain-just-exploded/#comment-37720</guid>
		<description>hi.Can you tell me,how to write in Haskell the pythagors numbers.
Example:
&gt; pyths 10
[(3,4,5),(4,3,5),(6,8,10),(8,6,10)]
Main&gt; pyths 5
[(3,4,5),(4,3,5)]

Condition is: You have to use (map or filter、concat、if sentence.)
Please help me!
theory_1027@yahoo.com</description>
		<content:encoded><![CDATA[<p>hi.Can you tell me,how to write in Haskell the pythagors numbers.<br />
Example:<br />
&gt; pyths 10<br />
[(3,4,5),(4,3,5),(6,8,10),(8,6,10)]<br />
Main&gt; pyths 5<br />
[(3,4,5),(4,3,5)]</p>
<p>Condition is: You have to use (map or filter、concat、if sentence.)<br />
Please help me!<br />
<a href="mailto:theory_1027@yahoo.com">theory_1027@yahoo.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kshitij</title>
		<link>http://enfranchisedmind.com/blog/posts/i-think-my-brain-just-exploded/#comment-32668</link>
		<dc:creator>kshitij</dc:creator>
		<pubDate>Tue, 26 Feb 2008 10:47:17 +0000</pubDate>
		<guid isPermaLink="false">http://enfranchisedmind.com/blog/2007/12/28/i-think-my-brain-just-exploded/#comment-32668</guid>
		<description>for parselmouths:

filter(lambda (x, y, z): x*x + y*y == z*z, [(a, b, c) for a in range (1, n+1) for b in range (a, n+1) for c in range(b, n+1)])

obviously, the haskell and python versions are idea-wise isomorphic.

and here&#039;s a kind of O(n^2) version . the range for the multiplying factor (mu) is off the top of my head, and is there to take the output from the p-q stuff (eg (3,4,5)) and get the derived triplets (eg (6,8,10) and (12,16,20)). i say &quot;kind of&quot; O(n^2) because the generation of unique triplets is O(n^2) at minimum, and multiplying each of the integers in the triplet to get all the derived triplets is an additional operation. i don&#039;t have the upper bound for the multiplying factor, though if it can be proved that such a bound exists and is independent of n, the algorithm would become strictly -- as opposed to &quot;kind of&quot; -- O(n^2)

filter(lambda (a, b, c): max(a, b, c) &lt;= n, [(p*q*mu, ((p**2 - q**2)/2)*mu, ((p**2 + q**2)/2)*mu) for q in range(1,n,2) for p in range(q+2,n,2) for mu in range(1, 5)])</description>
		<content:encoded><![CDATA[<p>for parselmouths:</p>
<p>filter(lambda (x, y, z): x*x + y*y == z*z, [(a, b, c) for a in range (1, n+1) for b in range (a, n+1) for c in range(b, n+1)])</p>
<p>obviously, the haskell and python versions are idea-wise isomorphic.</p>
<p>and here&#8217;s a kind of O(n^2) version . the range for the multiplying factor (mu) is off the top of my head, and is there to take the output from the p-q stuff (eg (3,4,5)) and get the derived triplets (eg (6,8,10) and (12,16,20)). i say &#8220;kind of&#8221; O(n^2) because the generation of unique triplets is O(n^2) at minimum, and multiplying each of the integers in the triplet to get all the derived triplets is an additional operation. i don&#8217;t have the upper bound for the multiplying factor, though if it can be proved that such a bound exists and is independent of n, the algorithm would become strictly &#8212; as opposed to &#8220;kind of&#8221; &#8212; O(n^2)</p>
<p>filter(lambda (a, b, c): max(a, b, c) &lt;= n, [(p*q*mu, ((p**2 - q**2)/2)*mu, ((p**2 + q**2)/2)*mu) for q in range(1,n,2) for p in range(q+2,n,2) for mu in range(1, 5)])</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DavidLG</title>
		<link>http://enfranchisedmind.com/blog/posts/i-think-my-brain-just-exploded/#comment-32254</link>
		<dc:creator>DavidLG</dc:creator>
		<pubDate>Mon, 31 Dec 2007 10:44:37 +0000</pubDate>
		<guid isPermaLink="false">http://enfranchisedmind.com/blog/2007/12/28/i-think-my-brain-just-exploded/#comment-32254</guid>
		<description>Replying to the original post, you can do the same thing in Scala:

def f(n:Int) = for(x &lt;- 1 to n; y &lt;- (x+1) to n; z &lt;- (y+1) to n; if x*x + y*y == z*z) yield (x,y,z);

The Scala compiler infers the return type of the function, Seq[(Int,Int,Int)], and compiles the code into statically-typed JVM bytecodes.</description>
		<content:encoded><![CDATA[<p>Replying to the original post, you can do the same thing in Scala:</p>
<p>def f(n:Int) = for(x &lt;- 1 to n; y &lt;- (x+1) to n; z &lt;- (y+1) to n; if x*x + y*y == z*z) yield (x,y,z);</p>
<p>The Scala compiler infers the return type of the function, Seq[(Int,Int,Int)], and compiles the code into statically-typed JVM bytecodes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian</title>
		<link>http://enfranchisedmind.com/blog/posts/i-think-my-brain-just-exploded/#comment-32251</link>
		<dc:creator>Brian</dc:creator>
		<pubDate>Mon, 31 Dec 2007 01:26:23 +0000</pubDate>
		<guid isPermaLink="false">http://enfranchisedmind.com/blog/2007/12/28/i-think-my-brain-just-exploded/#comment-32251</guid>
		<description>Spruce Moose: actually, I&#039;m not working on Project Euler.  This was something different.</description>
		<content:encoded><![CDATA[<p>Spruce Moose: actually, I&#8217;m not working on Project Euler.  This was something different.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian</title>
		<link>http://enfranchisedmind.com/blog/posts/i-think-my-brain-just-exploded/#comment-32249</link>
		<dc:creator>Brian</dc:creator>
		<pubDate>Sun, 30 Dec 2007 23:17:05 +0000</pubDate>
		<guid isPermaLink="false">http://enfranchisedmind.com/blog/2007/12/28/i-think-my-brain-just-exploded/#comment-32249</guid>
		<description>Programming is a bad choice for people who are bad in math stuff, IMHO.</description>
		<content:encoded><![CDATA[<p>Programming is a bad choice for people who are bad in math stuff, IMHO.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

