prim numbers


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.

Eratosthenes search up to as limit with option and start on Zotac

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.
with n = on Zotac

Rolf LANG - Remsstr. 39 - 71384 Weinstadt | 03:11:57 up 4 days, 14:01, 0 users, load average: 0.11, 0.13, 0.10