Try to calc the first prim numbers up to a limit.
We use the the sieve of Eratosthenes. It is a simple, ancient algorithm for finding all prime numbers up to any given limit.
It does so by iteratively marking as composite (i.e., not prime) the multiples of each prime, starting with the multiples of 2.
The sieve of Eratosthenes is one of the most efficient ways to find all of the smaller primes.
It is named after Eratosthenes of Cyrene, a Greek mathematician.
Warning: Undefined array key "n" in /var/www/html/body/prim/index.php on line 18
Warning: Undefined array key "opt" in /var/www/html/body/prim/index.php on line 19
To find realy big primes, we build a Mersenne prim of the form 2 n -1.
Not all numbers are prim, so we check for a given n, if we have really a prim number, using Lucas-Lehmer test.
Warning: Undefined array key "n" in /var/www/html/body/prim/index.php on line 137
Warning: Undefined array key "opt" in /var/www/html/body/prim/index.php on line 138