<?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: Project Euler in F# &#8211; Problem 36</title>
	<atom:link href="http://www.fsharp.it/2008/10/08/project-euler-in-f-problem-36/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fsharp.it/2008/10/08/project-euler-in-f-problem-36/</link>
	<description>Functional programming on .Net</description>
	<lastBuildDate>Wed, 23 Mar 2011 17:29:06 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Dimchansky</title>
		<link>http://www.fsharp.it/2008/10/08/project-euler-in-f-problem-36/comment-page-1/#comment-1180</link>
		<dc:creator>Dimchansky</dc:creator>
		<pubDate>Sat, 29 Nov 2008 16:00:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.fsharp.it/?p=56#comment-1180</guid>
		<description>[fsharp]
#light

let isSymmetric str = 
    let rec isSymmetric_aux (str:string) s e =
        if e - s &gt; 0
        then
            if (str.[s]  str.[e])
            then false
            else isSymmetric_aux str (s+1) (e-1)
        else true   
    isSymmetric_aux str 0 ((String.length str) - 1)    

let answer =
    {1..999999} &#124;&gt;
    Seq.filter (fun v -&gt; (System.Convert.ToString(v,10) &#124;&gt; isSymmetric) &amp;&amp; (System.Convert.ToString(v,2) &#124;&gt; isSymmetric)) &#124;&gt;
    Seq.fold (+) 0
[/fsharp]</description>
		<content:encoded><![CDATA[<pre class="brush: fsharp">
#light

let isSymmetric str =
    let rec isSymmetric_aux (str:string) s e =
        if e - s &gt; 0
        then
            if (str.[s]  str.[e])
            then false
            else isSymmetric_aux str (s+1) (e-1)
        else true
    isSymmetric_aux str 0 ((String.length str) - 1)    

let answer =
    {1..999999} |&gt;
    Seq.filter (fun v -&gt; (System.Convert.ToString(v,10) |&gt; isSymmetric) &amp;&amp; (System.Convert.ToString(v,2) |&gt; isSymmetric)) |&gt;
    Seq.fold (+) 0
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>

