<?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: Euler Problem 22</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2009/01/02/euler-problem-22/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2009/01/02/euler-problem-22/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Wed, 08 Feb 2012 23:58:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Hans Schraven</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/01/02/euler-problem-22/#comment-36850</link>
		<dc:creator>Hans Schraven</dc:creator>
		<pubDate>Mon, 05 Jan 2009 12:01:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1932#comment-36850</guid>
		<description>&lt;p&gt;Some improvements:&lt;/p&gt;
&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container vb default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;vb codecolorer&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; euler22()&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; c1 &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Single&lt;/span&gt;, c2 &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, T &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, j &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Integer&lt;/span&gt;, jj &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Integer&lt;/span&gt;, Rng &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; Range&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Const&lt;/span&gt; c0 = &lt;span class=&quot;st0&quot;&gt;&quot;ACDEFGHIJKLMNOPQRSTUVWXYZ&quot;&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;br&gt;
&#160; T = Timer&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;E:download
ames.txt&quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Input&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; #1&lt;br&gt;
&#160; &#160; sq = Split(Mid(&lt;span class=&quot;kw1&quot;&gt;Input&lt;/span&gt;(LOF(1) - 1, #1), 2), &lt;span class=&quot;st0&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;,&quot;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;&quot;&lt;/span&gt;)&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Close&lt;/span&gt; #1&lt;br&gt;
&lt;br&gt;
&#160; Workbooks.Add&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Set&lt;/span&gt; Rng = ActiveWorkbook.Sheets(1).Cells(1, 1).Resize(&lt;span class=&quot;kw1&quot;&gt;UBound&lt;/span&gt;(sq) + 1)&lt;br&gt;
&#160; Rng = Application.WorksheetFunction.Transpose(sq)&lt;br&gt;
&#160; Rng.Sort [A1]&lt;br&gt;
&#160; sq = Rng&lt;br&gt;
&#160; &#160; &lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; j = 1 &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;UBound&lt;/span&gt;(sq)&lt;br&gt;
&#160; &#160; c1 = 0&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; jj = 1 &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; Len(sq(j, 1))&lt;br&gt;
&#160; &#160; &#160; c1 = c1 + InStr(c0, Mid(sq(j, 1), jj, 1))&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt;&lt;br&gt;
&#160; &#160; c2 = c2 + (c1 * j)&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;br&gt;
&#160; Debug.&lt;span class=&quot;kw1&quot;&gt;Print&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;total: &quot;&lt;/span&gt; &amp; c2 &amp; &lt;span class=&quot;st0&quot;&gt;&quot; time: &quot;&lt;/span&gt; &amp; Timer - T&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
</description>
		<content:encoded><![CDATA[<p>Some improvements:</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Sub</span> euler22()<br />
&nbsp; <span class="kw1">Dim</span> c1 <span class="kw1">As</span> <span class="kw1">Single</span>, c2 <span class="kw1">As</span> <span class="kw1">Long</span>, T <span class="kw1">As</span> <span class="kw1">Long</span>, j <span class="kw1">As</span> <span class="kw1">Integer</span>, jj <span class="kw1">As</span> <span class="kw1">Integer</span>, Rng <span class="kw1">As</span> Range<br />
&nbsp; <span class="kw1">Const</span> c0 = <span class="st0">&#8220;ACDEFGHIJKLMNOPQRSTUVWXYZ&#8221;</span><br />
&nbsp; &nbsp; <br />
&nbsp; T = Timer<br />
&nbsp; <span class="kw1">Open</span> <span class="st0">&#8220;E:download<br />
ames.txt&#8221;</span> <span class="kw1">For</span> <span class="kw1">Input</span> <span class="kw1">As</span> #1<br />
&nbsp; &nbsp; sq = Split(Mid(<span class="kw1">Input</span>(LOF(1) &#8211; 1, #1), 2), <span class="st0">&#8220;&#8221;</span><span class="st0">&#8220;,&#8221;</span><span class="st0">&#8220;&#8221;</span>)<br />
&nbsp; <span class="kw1">Close</span> #1</p>
<p>&nbsp; Workbooks.Add<br />
&nbsp; <span class="kw1">Set</span> Rng = ActiveWorkbook.Sheets(1).Cells(1, 1).Resize(<span class="kw1">UBound</span>(sq) + 1)<br />
&nbsp; Rng = Application.WorksheetFunction.Transpose(sq)<br />
&nbsp; Rng.Sort [A1]<br />
&nbsp; sq = Rng<br />
&nbsp; &nbsp; <br />
&nbsp; <span class="kw1">For</span> j = 1 <span class="kw1">To</span> <span class="kw1">UBound</span>(sq)<br />
&nbsp; &nbsp; c1 = 0<br />
&nbsp; &nbsp; <span class="kw1">For</span> jj = 1 <span class="kw1">To</span> Len(sq(j, 1))<br />
&nbsp; &nbsp; &nbsp; c1 = c1 + InStr(c0, Mid(sq(j, 1), jj, 1))<br />
&nbsp; &nbsp; <span class="kw1">Next</span><br />
&nbsp; &nbsp; c2 = c2 + (c1 * j)<br />
&nbsp; <span class="kw1">Next</span><br />
&nbsp; &nbsp; <br />
&nbsp; Debug.<span class="kw1">Print</span> <span class="st0">&#8220;total: &#8220;</span> &amp;amp; c2 &amp;amp; <span class="st0">&#8221; time: &#8220;</span> &amp;amp; Timer &#8211; T<br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hans Schraven</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/01/02/euler-problem-22/#comment-36811</link>
		<dc:creator>Hans Schraven</dc:creator>
		<pubDate>Sat, 03 Jan 2009 14:22:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1932#comment-36811</guid>
		<description>&lt;p&gt;This runs in less than a second&lt;/p&gt;
&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container vb default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;vb codecolorer&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; euler22()&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; c0 &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt;, c1 &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, c2 &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, t &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Single&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;br&gt;
&#160; t = Timer&lt;br&gt;
&#160; c0 = &lt;span class=&quot;st0&quot;&gt;&quot;ACDEFGHIJKLMNOPQRSTUVWXYZ&quot;&lt;/span&gt;&lt;br&gt;
&#160; Workbooks.&lt;span class=&quot;kw1&quot;&gt;Open&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;E:download
ames.txt&quot;&lt;/span&gt;&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;With&lt;/span&gt; ActiveWorkbook.Sheets(1)&lt;br&gt;
&#160; &#160; sq = Split(Replace(Join(Split(.Range(&lt;span class=&quot;st0&quot;&gt;&quot;A1&quot;&lt;/span&gt;), &lt;span class=&quot;st0&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;,&quot;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;&quot;&lt;/span&gt;), &lt;span class=&quot;st0&quot;&gt;&quot;&#124;&quot;&lt;/span&gt;), &lt;span class=&quot;st0&quot;&gt;&quot;,&quot;&lt;/span&gt; &amp; Chr(34), &lt;span class=&quot;st0&quot;&gt;&quot;&#124;&quot;&lt;/span&gt;), &lt;span class=&quot;st0&quot;&gt;&quot;&#124;&quot;&lt;/span&gt;)&lt;br&gt;
&#160; &#160; .Range(&lt;span class=&quot;st0&quot;&gt;&quot;A1&quot;&lt;/span&gt;).Resize(&lt;span class=&quot;kw1&quot;&gt;UBound&lt;/span&gt;(sq)) = Application.WorksheetFunction.Transpose(sq)&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;With&lt;/span&gt; .Columns(1)&lt;br&gt;
&#160; &#160; &#160; .Sort [A1]&lt;br&gt;
&#160; &#160; &#160; sq = .SpecialCells(xlCellTypeConstants)&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;With&lt;/span&gt;&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;With&lt;/span&gt;&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; j = 1 &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;UBound&lt;/span&gt;(sq)&lt;br&gt;
&#160; &#160; c1 = 0&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; jj = 1 &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; Len(sq(j, 1))&lt;br&gt;
&#160; &#160; &#160; c1 = c1 + InStr(c0, Mid(sq(j, 1), jj, 1))&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt;&lt;br&gt;
&#160; &#160; c2 = c2 + c1 * j&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt;&lt;br&gt;
&#160; t = Timer - t&lt;br&gt;
&#160; Debug.&lt;span class=&quot;kw1&quot;&gt;Print&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;total &quot;&lt;/span&gt; &amp; c2 &amp; &lt;span class=&quot;st0&quot;&gt;&quot; time &quot;&lt;/span&gt; &amp; t&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
</description>
		<content:encoded><![CDATA[<p>This runs in less than a second</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Sub</span> euler22()<br />
&nbsp; <span class="kw1">Dim</span> c0 <span class="kw1">As</span> <span class="kw1">String</span>, c1 <span class="kw1">As</span> <span class="kw1">Long</span>, c2 <span class="kw1">As</span> <span class="kw1">Long</span>, t <span class="kw1">As</span> <span class="kw1">Single</span><br />
&nbsp; &nbsp; <br />
&nbsp; t = Timer<br />
&nbsp; c0 = <span class="st0">&#8220;ACDEFGHIJKLMNOPQRSTUVWXYZ&#8221;</span><br />
&nbsp; Workbooks.<span class="kw1">Open</span> <span class="st0">&#8220;E:download<br />
ames.txt&#8221;</span><br />
&nbsp; <span class="kw1">With</span> ActiveWorkbook.Sheets(1)<br />
&nbsp; &nbsp; sq = Split(Replace(Join(Split(.Range(<span class="st0">&#8220;A1&#8243;</span>), <span class="st0">&#8220;&#8221;</span><span class="st0">&#8220;,&#8221;</span><span class="st0">&#8220;&#8221;</span>), <span class="st0">&#8220;|&#8221;</span>), <span class="st0">&#8220;,&#8221;</span> &amp;amp; Chr(34), <span class="st0">&#8220;|&#8221;</span>), <span class="st0">&#8220;|&#8221;</span>)<br />
&nbsp; &nbsp; .Range(<span class="st0">&#8220;A1&#8243;</span>).Resize(<span class="kw1">UBound</span>(sq)) = Application.WorksheetFunction.Transpose(sq)<br />
&nbsp; &nbsp; <span class="kw1">With</span> .Columns(1)<br />
&nbsp; &nbsp; &nbsp; .Sort [A1]<br />
&nbsp; &nbsp; &nbsp; sq = .SpecialCells(xlCellTypeConstants)<br />
&nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">With</span><br />
&nbsp; <span class="kw1">End</span> <span class="kw1">With</span><br />
&nbsp; <span class="kw1">For</span> j = 1 <span class="kw1">To</span> <span class="kw1">UBound</span>(sq)<br />
&nbsp; &nbsp; c1 = 0<br />
&nbsp; &nbsp; <span class="kw1">For</span> jj = 1 <span class="kw1">To</span> Len(sq(j, 1))<br />
&nbsp; &nbsp; &nbsp; c1 = c1 + InStr(c0, Mid(sq(j, 1), jj, 1))<br />
&nbsp; &nbsp; <span class="kw1">Next</span><br />
&nbsp; &nbsp; c2 = c2 + c1 * j<br />
&nbsp; <span class="kw1">Next</span><br />
&nbsp; t = Timer &#8211; t<br />
&nbsp; Debug.<span class="kw1">Print</span> <span class="st0">&#8220;total &#8220;</span> &amp;amp; c2 &amp;amp; <span class="st0">&#8221; time &#8220;</span> &amp;amp; t<br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: dbb</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/01/02/euler-problem-22/#comment-36801</link>
		<dc:creator>dbb</dc:creator>
		<pubDate>Sat, 03 Jan 2009 01:55:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1932#comment-36801</guid>
		<description>&lt;p&gt;This is also one of the few Euler problems you can do entirely in a worksheet&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This is also one of the few Euler problems you can do entirely in a worksheet</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tushar Mehta</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/01/02/euler-problem-22/#comment-36800</link>
		<dc:creator>Tushar Mehta</dc:creator>
		<pubDate>Sat, 03 Jan 2009 01:48:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1932#comment-36800</guid>
		<description>&lt;p&gt;For a code-less solution see &lt;a href=&quot;http://www.tushar-mehta.com/misc_tutorials/project_euler/euler022.html&quot; rel=&quot;nofollow&quot;&gt;http://www.tushar-mehta.com/misc_tutorials/project_euler/euler022.html&lt;/a&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>For a code-less solution see <a href="http://www.tushar-mehta.com/misc_tutorials/project_euler/euler022.html" rel="nofollow">http://www.tushar-mehta.com/misc_tutorials/project_euler/euler022.html</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

