<?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 for I Write</title>
	<atom:link href="http://dharampal.name/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://dharampal.name</link>
	<description>A blog about nothing in particular</description>
	<lastBuildDate>Tue, 22 Jun 2010 05:27:38 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>Comment on Sum of all the primes below two million by Graham</title>
		<link>http://dharampal.name/2008/12/25/sum-of-all-the-primes-below-two-million/comment-page-1/#comment-2020</link>
		<dc:creator>Graham</dc:creator>
		<pubDate>Tue, 22 Jun 2010 05:27:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dharampal.name/?p=23#comment-2020</guid>
		<description>Beyond the sieve, there is one other thing you can do: You only need to check for prime status up to the square root of the number in question: if you are considering the number 100 for example, you will have found a number it&#039;s divisible by by the time you hit 10. This will seriously speed up your program. I couldn&#039;t get it under the one minute limit until I did, and then I got it to run in 20 seconds.

As far as implementing the sieve, you don&#039;t have to implement all of it, but kudos to you for figuring it out. For my solution, (because I didn&#039;t feel like figuring out how to write a sieve that elaborate) I simply used odd numbers. 

The reason these calculations are taking so much longer to run than you anticipate is you are using the shortest chunks of time to calculate how long it should take to locate a prime: ie, the first 20000 or so. Each of these requires 2 (or more) orders of magnitude fewer iterations than say 1900000 to 2000000. 

You probably have this way figured out by now considering the age of the post, but I just figured it out, and enjoyed doing so immensely. F# is new to me, so I&#039;m guessing at some of your lines of code. I&#039;m a C guy myself.</description>
		<content:encoded><![CDATA[<p>Beyond the sieve, there is one other thing you can do: You only need to check for prime status up to the square root of the number in question: if you are considering the number 100 for example, you will have found a number it&#8217;s divisible by by the time you hit 10. This will seriously speed up your program. I couldn&#8217;t get it under the one minute limit until I did, and then I got it to run in 20 seconds.</p>
<p>As far as implementing the sieve, you don&#8217;t have to implement all of it, but kudos to you for figuring it out. For my solution, (because I didn&#8217;t feel like figuring out how to write a sieve that elaborate) I simply used odd numbers. </p>
<p>The reason these calculations are taking so much longer to run than you anticipate is you are using the shortest chunks of time to calculate how long it should take to locate a prime: ie, the first 20000 or so. Each of these requires 2 (or more) orders of magnitude fewer iterations than say 1900000 to 2000000. </p>
<p>You probably have this way figured out by now considering the age of the post, but I just figured it out, and enjoyed doing so immensely. F# is new to me, so I&#8217;m guessing at some of your lines of code. I&#8217;m a C guy myself.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on muffled thoughts.. by Daily News About Personal : A few links about Personal - Sunday, 31 May 2009 14:26</title>
		<link>http://dharampal.name/2009/06/01/muffled-thoughts/comment-page-1/#comment-26</link>
		<dc:creator>Daily News About Personal : A few links about Personal - Sunday, 31 May 2009 14:26</dc:creator>
		<pubDate>Sun, 31 May 2009 22:14:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dharampal.name/?p=69#comment-26</guid>
		<description>[...] muffled thoughts.. [...]</description>
		<content:encoded><![CDATA[<p>[...] muffled thoughts.. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on First triangle number to have over five hundred divisors by codemangler</title>
		<link>http://dharampal.name/2009/01/28/first-triangle-number-to-have-over-five-hundred-divisors/comment-page-1/#comment-6</link>
		<dc:creator>codemangler</dc:creator>
		<pubDate>Sat, 21 Mar 2009 21:28:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dharampal.name/?p=56#comment-6</guid>
		<description>&lt;a href=&quot;#comment-6&quot; rel=&quot;nofollow&quot;&gt;@PherricOxide&lt;/a&gt;
Thanks for the tip :)</description>
		<content:encoded><![CDATA[<p><a href="#comment-6" rel="nofollow">@PherricOxide</a><br />
Thanks for the tip <img src='http://dharampal.name/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on First triangle number to have over five hundred divisors by PherricOxide</title>
		<link>http://dharampal.name/2009/01/28/first-triangle-number-to-have-over-five-hundred-divisors/comment-page-1/#comment-5</link>
		<dc:creator>PherricOxide</dc:creator>
		<pubDate>Fri, 20 Mar 2009 04:11:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dharampal.name/?p=56#comment-5</guid>
		<description>If you wanted to save a few seconds, you can save on all that multiplication and division when finding the triangle numbers and just make a function that makes use of the last one. This would return the n&#039;th element of the triangle sum sequence when given the n-1 element.

trinalgenum(int n, int lastterm) {
  return lastterm + n;
}

1st term: 1
2nd term: 1st term + 2
3rd term: 2nd term + 3... etc.</description>
		<content:encoded><![CDATA[<p>If you wanted to save a few seconds, you can save on all that multiplication and division when finding the triangle numbers and just make a function that makes use of the last one. This would return the n&#8217;th element of the triangle sum sequence when given the n-1 element.</p>
<p>trinalgenum(int n, int lastterm) {<br />
  return lastterm + n;<br />
}</p>
<p>1st term: 1<br />
2nd term: 1st term + 2<br />
3rd term: 2nd term + 3&#8230; etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Project Euler by I Write &#187; Sum of all the primes below two million</title>
		<link>http://dharampal.name/2008/12/23/project-euler/comment-page-1/#comment-3</link>
		<dc:creator>I Write &#187; Sum of all the primes below two million</dc:creator>
		<pubDate>Thu, 25 Dec 2008 12:48:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dharampal.name/?p=20#comment-3</guid>
		<description>[...] written about Project Euler in my previous post (which I guess was the day before yesterday). I was going pretty well with solving the problems [...]</description>
		<content:encoded><![CDATA[<p>[...] written about Project Euler in my previous post (which I guess was the day before yesterday). I was going pretty well with solving the problems [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
