<?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 100</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2009/05/09/euler-problem-100/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2009/05/09/euler-problem-100/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Thu, 09 Feb 2012 19:28:40 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Thad Beier</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/05/09/euler-problem-100/#comment-39823</link>
		<dc:creator>Thad Beier</dc:creator>
		<pubDate>Fri, 12 Jun 2009 23:47:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=2440#comment-39823</guid>
		<description>&lt;p&gt;I noticed that the solutions are a factor of 5.8284 (sqrt(2) + 1)^2 apart.  So, using the &quot;don&#039;t try this&quot; method of adding one to T or B actually works if you can get a good guess for the start. Values for T are 21, 120, 697, 4060, 23661, ...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I noticed that the solutions are a factor of 5.8284 (sqrt(2) + 1)^2 apart.  So, using the &#8220;don&#8217;t try this&#8221; method of adding one to T or B actually works if you can get a good guess for the start. Values for T are 21, 120, 697, 4060, 23661, &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug Jenkins</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/05/09/euler-problem-100/#comment-39297</link>
		<dc:creator>Doug Jenkins</dc:creator>
		<pubDate>Mon, 11 May 2009 08:10:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=2440#comment-39297</guid>
		<description>&lt;p&gt;Michael - very neat.  At first I couldn&#039;t see why precision would be a problem, but a quick trial verified that it was.  I then set up a brute force solution using the decimal data type, which gives 28 significant figures, but is way too slow unless you know the answer already.&lt;/p&gt;
&lt;p&gt;FWIW, here is the code using decimals:&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;Function&lt;/span&gt; P_100(Min_discs &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Double&lt;/span&gt;) &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Variant&lt;/span&gt;&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; B &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Variant&lt;/span&gt;, n &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Variant&lt;/span&gt;, Prob &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Variant&lt;/span&gt;, ans(1 &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; 3, 1 &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; 1) &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Double&lt;/span&gt;&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; b_2 &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Variant&lt;/span&gt;, n_2 &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Variant&lt;/span&gt;, Remain &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Variant&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
ans(3, 1) = Timer&lt;br&gt;
n = Min_discs - 1&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Do&lt;/span&gt;&lt;br&gt;
n = &lt;span class=&quot;kw1&quot;&gt;CDec&lt;/span&gt;(Int(n + 1))&lt;br&gt;
B = &lt;span class=&quot;kw1&quot;&gt;CDec&lt;/span&gt;(Int(n * 0.5 ^ 0.5) - 1)&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Do&lt;/span&gt;&lt;br&gt;
B = B + 1&lt;br&gt;
Prob = ((B / n) * ((B - 1) / (n - 1)))&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Loop&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;While&lt;/span&gt; Prob - 0.5 .LT. 0&lt;br&gt;
b_2 = &lt;span class=&quot;kw1&quot;&gt;CDec&lt;/span&gt;(B * (B - 1))&lt;br&gt;
n_2 = &lt;span class=&quot;kw1&quot;&gt;CDec&lt;/span&gt;(n * (n - 1))&lt;br&gt;
Remain = n_2 - (2 * b_2)&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Loop&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;While&lt;/span&gt; Abs(Remain) .GT. 0&lt;br&gt;
&lt;br&gt;
ans(1, 1) = B&lt;br&gt;
ans(2, 1) = n&lt;br&gt;
ans(3, 1) = Timer - ans(3, 1)&lt;br&gt;
P_100 = ans&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
</description>
		<content:encoded><![CDATA[<p>Michael &#8211; very neat.  At first I couldn&#8217;t see why precision would be a problem, but a quick trial verified that it was.  I then set up a brute force solution using the decimal data type, which gives 28 significant figures, but is way too slow unless you know the answer already.</p>
<p>FWIW, here is the code using decimals:</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Function</span> P_100(Min_discs <span class="kw1">As</span> <span class="kw1">Double</span>) <span class="kw1">As</span> <span class="kw1">Variant</span><br />
<span class="kw1">Dim</span> B <span class="kw1">As</span> <span class="kw1">Variant</span>, n <span class="kw1">As</span> <span class="kw1">Variant</span>, Prob <span class="kw1">As</span> <span class="kw1">Variant</span>, ans(1 <span class="kw1">To</span> 3, 1 <span class="kw1">To</span> 1) <span class="kw1">As</span> <span class="kw1">Double</span><br />
<span class="kw1">Dim</span> b_2 <span class="kw1">As</span> <span class="kw1">Variant</span>, n_2 <span class="kw1">As</span> <span class="kw1">Variant</span>, Remain <span class="kw1">As</span> <span class="kw1">Variant</span></p>
<p>ans(3, 1) = Timer<br />
n = Min_discs &#8211; 1<br />
<span class="kw1">Do</span><br />
n = <span class="kw1">CDec</span>(Int(n + 1))<br />
B = <span class="kw1">CDec</span>(Int(n * 0.5 ^ 0.5) &#8211; 1)</p>
<p><span class="kw1">Do</span><br />
B = B + 1<br />
Prob = ((B / n) * ((B &#8211; 1) / (n &#8211; 1)))<br />
<span class="kw1">Loop</span> <span class="kw1">While</span> Prob &#8211; 0.5 .LT. 0<br />
b_2 = <span class="kw1">CDec</span>(B * (B &#8211; 1))<br />
n_2 = <span class="kw1">CDec</span>(n * (n &#8211; 1))<br />
Remain = n_2 &#8211; (2 * b_2)<br />
<span class="kw1">Loop</span> <span class="kw1">While</span> Abs(Remain) .GT. 0</p>
<p>ans(1, 1) = B<br />
ans(2, 1) = n<br />
ans(3, 1) = Timer &#8211; ans(3, 1)<br />
P_100 = ans</p>
<p><span class="kw1">End</span> <span class="kw1">Function</span></div>
</div>
]]></content:encoded>
	</item>
</channel>
</rss>

