<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sat, 25 May 2013 04:37:00 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Klaus Graefensteiner's Blog: Two ways to test for prime numbers in PHP: Sieve and File]]></title>
      <guid>http://www.phpdeveloper.org/news/14099</guid>
      <link>http://www.phpdeveloper.org/news/14099</link>
      <description><![CDATA[<p>
In a new post to his blog <i>Klaus Graefensteiner</i> takes a look at <a href="http://www.tellingmachine.com/post/Two-ways-to-test-for-prime-numbers-in-PHP-Sieve-and-File.aspx">two ways to test for prime numbers</a> both with Sieve and from a file.
</p>
<blockquote>
In PHP is really no ideal way to test large integers and determine whether they are prime numbers or not. The most popular algorithm for finding prime numbers is a memory and resource hog. It is called The <A href="http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes">Sieve of Eratosthenes</a>.
</blockquote>
<p>
You can get more of an idea on this method in <a href="http://www.youtube.com/watch?v=9m2cdWorIq8">this video </a> and in <a href="http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes">this example</a> from Wikipedia. He includes the full source for his solution that includes methods like isInteger, isPositive, isPerfectSquare and isPalindromicPrime. The script is also available for <a href="http://www.tellingmachine.com/file.axd?file=PrimesWIthSieveAndFromFile.zip">download</a>.
</p>]]></description>
      <pubDate>Fri, 26 Feb 2010 13:33:43 -0600</pubDate>
    </item>
  </channel>
</rss>
