<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Serabe Reloaded &#187; RubyEuler</title>
	<atom:link href="http://www.serabe.com/category/programacion/ruby/rubyeuler/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.serabe.com</link>
	<description>Conecto ergo sum. Non conecto ergo urgueo.</description>
	<lastBuildDate>Sun, 09 Oct 2011 21:30:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Problem 3</title>
		<link>http://www.serabe.com/2008/10/12/problem-3/</link>
		<comments>http://www.serabe.com/2008/10/12/problem-3/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 14:13:42 +0000</pubDate>
		<dc:creator>Serabe</dc:creator>
				<category><![CDATA[Anti-GOTAM]]></category>
		<category><![CDATA[Maths]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[RubyEuler]]></category>
		<category><![CDATA[euler project]]></category>
		<category><![CDATA[problem 3]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[RbEuler]]></category>

		<guid isPermaLink="false">http://www.serabe.com/?p=259</guid>
		<description><![CDATA[Wording: (Original) The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? Solution: First the code: PLAIN TEXT RUBY: include Math def prime_factors&#40;num, factor=2&#41; &#160; return &#91;&#93;&#160; if num &#60;= 1 &#160; next_pf = &#40;factor..&#40;sqrt&#40;num&#41;.ceil&#41;&#41;.find&#40;lambda &#123;num&#125;&#41;&#123; &#124;x&#124; num%x == 0 &#125; &#160; return [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Wording:</strong> (<a href="http://projecteuler.net/index.php?section=problems&#038;id=3"  title="Project Euler">Original</a>) The prime factors of 13195 are 5, 7, 13 and 29.<br />
What is the largest prime factor of the number 600851475143 ?</p>
<p><strong>Solution:</strong><br />
First the code:</p>
<div class="igBar"><span id="lruby-2"><a href="#" onclick="javascript:showPlainTxt('ruby-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-2">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">include</span> Math</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> prime_factors<span style="color:#006600; font-weight:bold;">&#40;</span>num, factor=<span style="color:#006666;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span>&nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> num &lt;= <span style="color:#006666;color:#800000;">1</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; next_pf = <span style="color:#006600; font-weight:bold;">&#40;</span>factor..<span style="color:#006600; font-weight:bold;">&#40;</span>sqrt<span style="color:#006600; font-weight:bold;">&#40;</span>num<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">ceil</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">find</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0066; font-weight:bold;">lambda</span> <span style="color:#006600; font-weight:bold;">&#123;</span>num<span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span> |x| num%x == <span style="color:#006666;color:#800000;">0</span> <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#006600; font-weight:bold;">&#91;</span>next_pf<span style="color:#006600; font-weight:bold;">&#93;</span> + prime_factors<span style="color:#006600; font-weight:bold;">&#40;</span>num/next_pf, next_pf<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0066; font-weight:bold;">puts</span> prime_factors<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;color:#800000;">600851475143</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">max</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The code is a direct port from the one in PyEuler. It is based mainly in the idea that the first factor of a number is always prime.</p>
<p>Line 3 breaks recursion and line 4 works out the next prime factor (actually, it finds the smallest factor). For doing this, it uses find method. If no element match the criteria, then it returns the number (that is what the lambda block is for).</p>
<p>Finally, line 5 merges the results and line 8 print the result.</p>
<p>This time just one code is showed.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Problem 3 on Serabe Reloaded',url: 'http://www.serabe.com/2008/10/12/problem-3/',contentID: 'post-259',suggestTags: 'euler project,problem 3,programming,RbEuler,Ruby',providerName: 'Serabe Reloaded',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper.png" class="evernoteSiteMemoryButton" title="Problem 3" alt="article clipper Problem 3" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.serabe.com%2F2008%2F10%2F12%2Fproblem-3%2F&amp;title=Problem%203" id="wpa2a_2"><img src="http://www.serabe.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="share save 171 16 Problem 3"  title="Problem 3" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.serabe.com/2008/10/12/problem-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problema 2</title>
		<link>http://www.serabe.com/2008/03/23/problema-2/</link>
		<comments>http://www.serabe.com/2008/03/23/problema-2/#comments</comments>
		<pubDate>Sun, 23 Mar 2008 21:37:14 +0000</pubDate>
		<dc:creator>Serabe</dc:creator>
				<category><![CDATA[Anti-GOTAM]]></category>
		<category><![CDATA[Maths]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[RubyEuler]]></category>
		<category><![CDATA[euler project]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[RbEuler]]></category>

		<guid isPermaLink="false">http://www.serabe.com/2008/03/23/problema-2/</guid>
		<description><![CDATA[Enunciado: Suma todos los nÃºmeros pares de la sucesiÃ³n de Fibonacci menores que un cuatro millÃ³n. Primera soluciÃ³n: La primera soluciÃ³n es muy simple. Hay un mÃ©todo que devuelve un array con todos los nÃºmeros de la sucesiÃ³n de Fibonacci menores que un mÃ¡ximo max tomando como inicio un array de dos elementos arr. PLAIN [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Enunciado:</strong><br />
Suma todos los nÃºmeros pares de la sucesiÃ³n de Fibonacci menores que un <em>cuatro</em> millÃ³n.</p>
<p><strong>Primera soluciÃ³n:</strong></p>
<p>La primera soluciÃ³n es muy simple. Hay un mÃ©todo que devuelve un array con todos los nÃºmeros de la sucesiÃ³n de Fibonacci menores que un mÃ¡ximo <em>max</em> tomando como inicio un array de dos elementos <em>arr</em>.</p>
<div class="igBar"><span id="lruby-8"><a href="#" onclick="javascript:showPlainTxt('ruby-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-8">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> fib1<span style="color:#006600; font-weight:bold;">&#40;</span>max,arr=<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;color:#800000;">1</span>,<span style="color:#006666;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">while</span><span style="color:#006600; font-weight:bold;">&#40;</span>arr.<span style="color:#9900CC;">last</span> &lt;max<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; arr &lt;&lt;<span style="color:#006600; font-weight:bold;">&#40;</span>arr.<span style="color:#9900CC;">last</span>+arr<span style="color:#006600; font-weight:bold;">&#91;</span>arr.<span style="color:#9900CC;">size</span>-<span style="color:#006666;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; arr.<span style="color:#9900CC;">pop</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; arr</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>DespuÃ©s simplemente se eliminan los impares y se suman los que quedan.</p>
<div class="igBar"><span id="lruby-9"><a href="#" onclick="javascript:showPlainTxt('ruby-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-9">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> euler2a<span style="color:#006600; font-weight:bold;">&#40;</span>max, ini=<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;color:#800000;">1</span>,<span style="color:#006666;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; fib1<span style="color:#006600; font-weight:bold;">&#40;</span>max,ini<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">delete_if</span><span style="color:#006600; font-weight:bold;">&#123;</span>|x| x%<span style="color:#006666;color:#800000;">2</span> == <span style="color:#006666;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">inject</span><span style="color:#006600; font-weight:bold;">&#123;</span>|memo,obj| memo+obj<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0066; font-weight:bold;">puts</span> euler2a<span style="color:#006600; font-weight:bold;">&#40;</span>4e6<span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Segunda soluciÃ³n:</strong></p>
<p>Esta soluciÃ³n es un poco mejor. Se va a hacer un nuevo mÃ©todo que calcule todos los nÃºmeros de la sucesiÃ³n de Fibonacci menores que un mÃ¡ximo <strong>max</strong> pero que sÃ³lo almacene aquellos que pasen una condiciÃ³n que se le pasa como bloque:</p>
<div class="igBar"><span id="lruby-10"><a href="#" onclick="javascript:showPlainTxt('ruby-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-10">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> fib2<span style="color:#006600; font-weight:bold;">&#40;</span>max,a=<span style="color:#006666;color:#800000;">1</span>,b=<span style="color:#006666;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; arr = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; arr &lt;&lt;a <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#9966CC; font-weight:bold;">yield</span><span style="color:#006600; font-weight:bold;">&#40;</span>a<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">while</span><span style="color:#006600; font-weight:bold;">&#40;</span>b&lt;max<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; arr &lt;&lt;b <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#9966CC; font-weight:bold;">yield</span><span style="color:#006600; font-weight:bold;">&#40;</span>b<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; a,b=b,a+b</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; arr</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>DespuÃ©s sÃ³lo hace falta pasar el filtro adecuado, y sumar los resultados:</p>
<div class="igBar"><span id="lruby-11"><a href="#" onclick="javascript:showPlainTxt('ruby-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-11">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> euler2b<span style="color:#006600; font-weight:bold;">&#40;</span>max,a=<span style="color:#006666;color:#800000;">1</span>,b=<span style="color:#006666;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; fib2<span style="color:#006600; font-weight:bold;">&#40;</span>max,a,b<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span>|x| x%<span style="color:#006666;color:#800000;">2</span>==<span style="color:#006666;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">inject</span><span style="color:#006600; font-weight:bold;">&#123;</span>|memo,obj| memo+obj<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0066; font-weight:bold;">puts</span> euler2b<span style="color:#006600; font-weight:bold;">&#40;</span>4e6<span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Tercera soluciÃ³n:</strong></p>
<p>Esta tercera soluciÃ³n es una modificaciÃ³n directa de la segunda. En vez de almacenar los datos, se suman directamente.</p>
<div class="igBar"><span id="lruby-12"><a href="#" onclick="javascript:showPlainTxt('ruby-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-12">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> fib3<span style="color:#006600; font-weight:bold;">&#40;</span>max,a=<span style="color:#006666;color:#800000;">1</span>,b=<span style="color:#006666;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; res = <span style="color:#006666;color:#800000;">0</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; res += a <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#9966CC; font-weight:bold;">yield</span><span style="color:#006600; font-weight:bold;">&#40;</span>a<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">while</span><span style="color:#006600; font-weight:bold;">&#40;</span>b&lt;max<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; res += b <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#9966CC; font-weight:bold;">yield</span><span style="color:#006600; font-weight:bold;">&#40;</span>b<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; a,b=b,a+b</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; res</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> euler2c<span style="color:#006600; font-weight:bold;">&#40;</span>max,a=<span style="color:#006666;color:#800000;">1</span>,b=<span style="color:#006666;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; fib3<span style="color:#006600; font-weight:bold;">&#40;</span>max,a,b<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span>|x| x%<span style="color:#006666;color:#800000;">2</span>==<span style="color:#006666;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0066; font-weight:bold;">puts</span> euler2c<span style="color:#006600; font-weight:bold;">&#40;</span>4e6<span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Y eso es todo.</p>
<p><strong>ActualizaciÃ³n:</strong> Hay diferencias entre la pÃ¡gina de PyEuler y la del Proyecto Euler. El problema ha sido actualizado para corresponderse con esta Ãºltima.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Problema 2 on Serabe Reloaded',url: 'http://www.serabe.com/2008/03/23/problema-2/',contentID: 'post-165',suggestTags: 'euler project,Maths,Programming,programming,RbEuler,Ruby',providerName: 'Serabe Reloaded',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper.png" class="evernoteSiteMemoryButton" title="Problema 2" alt="article clipper Problema 2" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.serabe.com%2F2008%2F03%2F23%2Fproblema-2%2F&amp;title=Problema%202" id="wpa2a_4"><img src="http://www.serabe.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="share save 171 16 Problema 2"  title="Problema 2" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.serabe.com/2008/03/23/problema-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problema 1</title>
		<link>http://www.serabe.com/2008/02/27/problema-1/</link>
		<comments>http://www.serabe.com/2008/02/27/problema-1/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 12:20:56 +0000</pubDate>
		<dc:creator>Serabe</dc:creator>
				<category><![CDATA[Maths]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[RubyEuler]]></category>
		<category><![CDATA[RbEuler]]></category>

		<guid isPermaLink="false">http://www.serabe.com/2008/02/27/problema-1/</guid>
		<description><![CDATA[Empiezo aquÃ­ una serie de artÃ­culos de periodicidad variable que lo Ãºnico que pretende es ser algo similar (de una manera muy amplia) a PyEuler. La lista completa de problemas estÃ¡ en el Proyecto Euler y, como no podÃ­a ser de otra manera, empiezo por el primero. Enunciado: Halla la suma de todos los nÃºmeros [...]]]></description>
			<content:encoded><![CDATA[<p>Empiezo aquÃ­ una serie de artÃ­culos de periodicidad variable que lo Ãºnico que pretende es ser algo similar (de una manera muy amplia) a <a href="http://pyeuler.wikidot.com/"  title="Sitio de PyEuler">PyEuler</a>. La lista completa de problemas estÃ¡ en el <a href="http://projecteuler.net/"  title="Sitio del Proyecto Euler">Proyecto Euler</a> y, como no podÃ­a ser de otra manera, empiezo por el primero.</p>
<p><strong>Enunciado:</strong><br />
Halla la suma de todos los nÃºmeros menores que 1000 y mÃºltiplos de 3 o de 5.</p>
<p><strong>SoluciÃ³n 1:</strong></p>
<div class="igBar"><span id="lruby-18"><a href="#" onclick="javascript:showPlainTxt('ruby-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-18">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> euler1a<span style="color:#006600; font-weight:bold;">&#40;</span>e, numbers<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;color:#800000;">1</span>..<span style="color:#9900CC;">e</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#CC0066; font-weight:bold;">select</span><span style="color:#006600; font-weight:bold;">&#123;</span>|x| numbers.<span style="color:#9900CC;">any</span>?<span style="color:#006600; font-weight:bold;">&#123;</span>|y| <span style="color:#006600; font-weight:bold;">&#40;</span>x%y == <span style="color:#006666;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">inject</span><span style="color:#006600; font-weight:bold;">&#123;</span>|memo,o| memo+=o<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0066; font-weight:bold;">puts</span> euler1a<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;color:#800000;">1000</span>,<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;color:#800000;">3</span>,<span style="color:#006666;color:#800000;">5</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
La explicaciÃ³n es simple. Tenemos un rango desde 1 hasta el lÃ­mite, filtramos los que son mÃºltiplos de algÃºn elemento del array y despuÃ©s se suman.</p>
<p><strong>SoluciÃ³n 2:</strong></p>
<div class="igBar"><span id="lruby-19"><a href="#" onclick="javascript:showPlainTxt('ruby-19'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-19">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> euler1b<span style="color:#006600; font-weight:bold;">&#40;</span>e,numbers<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;color:#800000;">1</span>..<span style="color:#9900CC;">e</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">inject</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span>|memo,o| <span style="color:#006600; font-weight:bold;">&#40;</span>numbers.<span style="color:#9900CC;">any</span>?<span style="color:#006600; font-weight:bold;">&#123;</span>|x| <span style="color:#006600; font-weight:bold;">&#40;</span>o%x<span style="color:#006600; font-weight:bold;">&#41;</span>==<span style="color:#006666;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span> ? memo+o : memo <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0066; font-weight:bold;">puts</span> euler1b<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;color:#800000;">1000</span>,<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;color:#800000;">3</span>,<span style="color:#006666;color:#800000;">5</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
Ã‰ste es similar al anterior, sÃ³lo que se suma segÃºn se recorre el rango.</p>
<p><strong>SoluciÃ³n 3:</strong><br />
Para este necesitamos antes un par de funciones. La primera, halla el mÃ¡ximo comÃºn divisor de dos nÃºmeros. Para ello, bÃ¡sicamente usa el <a rel="nofollow" href="http://es.wikipedia.org/wiki/Algoritmo_de_Euclides"  title="Wikipedia">algoritmo de Euclides</a>.</p>
<div class="igBar"><span id="lruby-20"><a href="#" onclick="javascript:showPlainTxt('ruby-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-20">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> mcd<span style="color:#006600; font-weight:bold;">&#40;</span>n1,n2<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> n1 &lt;n2</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mcd<span style="color:#006600; font-weight:bold;">&#40;</span>n2,n1<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">elsif</span> <span style="color:#006600; font-weight:bold;">&#40;</span>n1%n2<span style="color:#006600; font-weight:bold;">&#41;</span> == <span style="color:#006666;color:#800000;">0</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; n2</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">else</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mcd<span style="color:#006600; font-weight:bold;">&#40;</span>n2,n1%n2<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Por otra parte, estÃ¡ la funciÃ³n que calcula el mÃ­nimo comÃºn mÃºltiplo. Para ello usa su relaciÃ³n con el <abbr title="MÃ¡ximo ComÃºn Divisor">m.c.d.</abbr>.</p>
<div class="igBar"><span id="lruby-21"><a href="#" onclick="javascript:showPlainTxt('ruby-21'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-21">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> mcm<span style="color:#006600; font-weight:bold;">&#40;</span>n1,n2<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; n1*n2/mcd<span style="color:#006600; font-weight:bold;">&#40;</span>n1,n2<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Con esto, ya podemos pasar a la tercera soluciÃ³n, que es diferente de las otras dos en que sÃ³lo sirve si utilizamos dos nÃºmeros como filtro.</p>
<div class="igBar"><span id="lruby-22"><a href="#" onclick="javascript:showPlainTxt('ruby-22'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-22">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> euler1c<span style="color:#006600; font-weight:bold;">&#40;</span>limit, n1, n2<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#40;</span>n1*<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span>limit/n1<span style="color:#006600; font-weight:bold;">&#41;</span>*<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span>limit/n1<span style="color:#006600; font-weight:bold;">&#41;</span>+<span style="color:#006666;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>/<span style="color:#006666;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span>+n2*<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span>limit/n2<span style="color:#006600; font-weight:bold;">&#41;</span>*<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span>limit/n2<span style="color:#006600; font-weight:bold;">&#41;</span>+<span style="color:#006666;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>/<span style="color:#006666;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span>-mcm<span style="color:#006600; font-weight:bold;">&#40;</span>n1,n2<span style="color:#006600; font-weight:bold;">&#41;</span>*<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span>limit/mcm<span style="color:#006600; font-weight:bold;">&#40;</span>n1,n2<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>*<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span>limit/mcm<span style="color:#006600; font-weight:bold;">&#40;</span>n1,n2<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>+<span style="color:#006666;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>/<span style="color:#006666;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0066; font-weight:bold;">puts</span> euler1c<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;color:#800000;">1000</span>,<span style="color:#006666;color:#800000;">3</span>,<span style="color:#006666;color:#800000;">5</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>La explicaciÃ³n es un poco mÃ¡s complicada, pues implica teorÃ­a bÃ¡sica de conjuntos y la conocida fÃ³rmula de la suma de 1 a n.</p>
<p>Ahora es vuestro turno. Â¿CÃ³mo se os ocurre hacerlo?</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Problema 1 on Serabe Reloaded',url: 'http://www.serabe.com/2008/02/27/problema-1/',contentID: 'post-148',suggestTags: 'Maths,RbEuler,Ruby',providerName: 'Serabe Reloaded',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper.png" class="evernoteSiteMemoryButton" title="Problema 1" alt="article clipper Problema 1" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.serabe.com%2F2008%2F02%2F27%2Fproblema-1%2F&amp;title=Problema%201" id="wpa2a_6"><img src="http://www.serabe.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="share save 171 16 Problema 1"  title="Problema 1" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.serabe.com/2008/02/27/problema-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

