<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Checking for a prime number</title><link>http://blogs.msdn.com/b/dboyle/archive/2013/03/08/checking-for-a-prime-number.aspx</link><description>Ok, looking back at the original post I'm nearly regretting it as I need to find the time to actually write these - but at least this one was quick and simple. In fact it may be too simple to use as a tech test, but anyways here it is. 
 A prime number</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Checking for a prime number</title><link>http://blogs.msdn.com/b/dboyle/archive/2013/03/08/checking-for-a-prime-number.aspx#10410476</link><pubDate>Fri, 12 Apr 2013 00:51:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10410476</guid><dc:creator>Comet</dc:creator><description>&lt;p&gt;If you are looking for clever maths, then see the &amp;quot;Agrawal–Kayal–Saxena primality test&amp;quot; as a &amp;nbsp;general, polynomial, deterministic, and unconditional algorithm. &amp;nbsp;If a candidate can explain it to you, then they are a &amp;quot;prime&amp;quot; candidate. &amp;nbsp;;-)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10410476" width="1" height="1"&gt;</description></item><item><title>re: Checking for a prime number</title><link>http://blogs.msdn.com/b/dboyle/archive/2013/03/08/checking-for-a-prime-number.aspx#10410473</link><pubDate>Fri, 12 Apr 2013 00:39:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10410473</guid><dc:creator>Comet</dc:creator><description>&lt;p&gt;You can go twice as fast, if you have a separate test for divisibility by 2, and iterate over the odd numbers as test divisors.&lt;/p&gt;
&lt;p&gt;You can finish your testing by an exponent of .5; namely, once your test divisor exceeds the square root of your candidate prime, you can terminate your loop.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10410473" width="1" height="1"&gt;</description></item></channel></rss>