- or download this
k = 3 - k;
- or download this
/* Sieve of Eratosthenes. Return a reference to an array containing a
+ll
* prime numbers less than or equal to search_to. Uses an optimized s
+ieve
...
av_push( av, newSVuv( static_cast<unsigned long>( i ) ) );
return newRV_noinc( (SV*) av );
}
- or download this
/* Sieve of Xuedong Luo (Algorithm3). Return a reference to an array
* containing all prime numbers less than or equal to search_to.
...
return newRV_noinc( (SV*) av );
}
- or download this
my $primes = primes( 1_000_000_000 );
...
There are 50,847,534 prime numbers between 1 and 1 billion.
- or download this
#
# Count primes
...
perl primeutil.pl 4_294_967_296 --print >/dev/null
Compute time : 13.470 sec
- or download this
Count primes
...
$ perl primeutil.pl 4294967296 --print >/dev/null
Compute time : 1.925 sec