Prime Number Script

Prime Number Script is generate a series of prime numbers, or find out if a particular number is prime.

Demo :

Select Number :  

Example :

Select Number : 20

Following code is used to generate prime numbers if you need to copy and use to your website.

function listPrimes($end)
  $sieve = range(2, $end);
  $size = sizeof($sieve);
  while (list($key, $val) = each($sieve))
  for ($x=$key+1; $x<$size; $x++)
    if ($sieve[$x] % $val == 0)
  return $sieve;
echo implode(" ", listPrimes(100));

A prime number is a number that has only two divisors: itself and 1. There are quite a few ways to generate a sequence of prime numbers, but the method listed previously is one of the oldest (and also one of the most efficient).

Free Download Script :

If you need Prime Number Script click and download from following link.