-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
11cd65b
commit ef99861
Showing
13 changed files
with
285 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
BSD 2-Clause License | ||
|
||
Copyright (c) 2013 - 2018, Kim Walisch. | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
primecount 4.4 | ||
May 9, 2018 | ||
Kim Walisch, <[email protected]> | ||
|
||
About primecount | ||
================ | ||
|
||
primecount is a command-line program that counts the number of | ||
primes below an integer x <= 10^31 using fast implementations of the | ||
prime counting function pi(x). | ||
|
||
Homepage: https://github.com/kimwalisch/primecount | ||
|
||
Usage examples | ||
============== | ||
|
||
Open a terminal and run: | ||
|
||
# Count the primes below 10^14 | ||
./primecount 1e14 | ||
|
||
# Print progress and status information during computation | ||
./primecount 1e20 --status | ||
|
||
# Count primes using Meissel's algorithm | ||
./primecount 2**32 --meissel | ||
|
||
# Find the 10^14th prime using 4 threads | ||
./primecount 1e14 --nthprime --threads=4 --time | ||
|
||
Command-line options | ||
==================== | ||
|
||
Usage: primecount x [OPTION]... | ||
Count the primes below x <= 10^31 using fast implementations of the | ||
combinatorial prime counting function. | ||
|
||
Options: | ||
|
||
-d, --deleglise_rivat Count primes using Deleglise-Rivat algorithm | ||
--legendre Count primes using Legendre's formula | ||
--lehmer Count primes using Lehmer's formula | ||
-l, --lmo Count primes using Lagarias-Miller-Odlyzko | ||
-m, --meissel Count primes using Meissel's formula | ||
--Li Approximate pi(x) using the logarithmic integral | ||
--Li_inverse Approximate the nth prime using Li^-1(x) | ||
-n, --nthprime Calculate the nth prime | ||
-p, --primesieve Count primes using the sieve of Eratosthenes | ||
--phi=<a> phi(x, a) counts the numbers <= x that are | ||
not divisible by any of the first a primes | ||
--Ri Approximate pi(x) using Riemann R | ||
--Ri_inverse Approximate the nth prime using Ri^-1(x) | ||
-s[N], --status[=N] Show computation progress 1%, 2%, 3%, ... | ||
[N] digits after decimal point e.g. N=1, 99.9% | ||
--test Run various correctness tests and exit | ||
--time Print the time elapsed in seconds | ||
-t<N>, --threads=<N> Set the number of threads, 1 <= N <= CPU cores | ||
-v, --version Print version and license information | ||
-h, --help Print this help menu | ||
|
||
Advanced Deleglise-Rivat options: | ||
|
||
-a<N>, --alpha=<N> Tuning factor, 1 <= alpha <= x^(1/6) | ||
--P2 Only compute the 2nd partial sieve function | ||
--S1 Only compute the ordinary leaves | ||
--S2_trivial Only compute the trivial special leaves | ||
--S2_easy Only compute the easy special leaves | ||
--S2_hard Only compute the hard special leaves | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
BSD 2-Clause License | ||
|
||
Copyright (c) 2013 - 2018, Kim Walisch. | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
69 changes: 69 additions & 0 deletions
69
Prototypes/Source/Primes/Binaries/MacOSX-x86-64/README.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
primecount 4.4 | ||
May 9, 2018 | ||
Kim Walisch, <[email protected]> | ||
|
||
About primecount | ||
================ | ||
|
||
primecount is a command-line program that counts the number of | ||
primes below an integer x <= 10^31 using fast implementations of the | ||
prime counting function pi(x). | ||
|
||
Homepage: https://github.com/kimwalisch/primecount | ||
|
||
Usage examples | ||
============== | ||
|
||
Open a terminal and run: | ||
|
||
# Count the primes below 10^14 | ||
./primecount 1e14 | ||
|
||
# Print progress and status information during computation | ||
./primecount 1e20 --status | ||
|
||
# Count primes using Meissel's algorithm | ||
./primecount 2**32 --meissel | ||
|
||
# Find the 10^14th prime using 4 threads | ||
./primecount 1e14 --nthprime --threads=4 --time | ||
|
||
Command-line options | ||
==================== | ||
|
||
Usage: primecount x [OPTION]... | ||
Count the primes below x <= 10^31 using fast implementations of the | ||
combinatorial prime counting function. | ||
|
||
Options: | ||
|
||
-d, --deleglise_rivat Count primes using Deleglise-Rivat algorithm | ||
--legendre Count primes using Legendre's formula | ||
--lehmer Count primes using Lehmer's formula | ||
-l, --lmo Count primes using Lagarias-Miller-Odlyzko | ||
-m, --meissel Count primes using Meissel's formula | ||
--Li Approximate pi(x) using the logarithmic integral | ||
--Li_inverse Approximate the nth prime using Li^-1(x) | ||
-n, --nthprime Calculate the nth prime | ||
-p, --primesieve Count primes using the sieve of Eratosthenes | ||
--phi=<a> phi(x, a) counts the numbers <= x that are | ||
not divisible by any of the first a primes | ||
--Ri Approximate pi(x) using Riemann R | ||
--Ri_inverse Approximate the nth prime using Ri^-1(x) | ||
-s[N], --status[=N] Show computation progress 1%, 2%, 3%, ... | ||
[N] digits after decimal point e.g. N=1, 99.9% | ||
--test Run various correctness tests and exit | ||
--time Print the time elapsed in seconds | ||
-t<N>, --threads=<N> Set the number of threads, 1 <= N <= CPU cores | ||
-v, --version Print version and license information | ||
-h, --help Print this help menu | ||
|
||
Advanced Deleglise-Rivat options: | ||
|
||
-a<N>, --alpha=<N> Tuning factor, 1 <= alpha <= x^(1/6) | ||
--P2 Only compute the 2nd partial sieve function | ||
--S1 Only compute the ordinary leaves | ||
--S2_trivial Only compute the trivial special leaves | ||
--S2_easy Only compute the easy special leaves | ||
--S2_hard Only compute the hard special leaves | ||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
BSD 2-Clause License | ||
|
||
Copyright (c) 2013 - 2018, Kim Walisch. | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
68 changes: 68 additions & 0 deletions
68
Prototypes/Source/Primes/Binaries/Windows-x86-64/README.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
primecount 4.4 | ||
May 9, 2018 | ||
Kim Walisch, <[email protected]> | ||
|
||
About primecount | ||
================ | ||
|
||
primecount is a command-line program that counts the number of | ||
primes below an integer x <= 10^31 using fast implementations of the | ||
prime counting function pi(x). | ||
|
||
Homepage: https://github.com/kimwalisch/primecount | ||
|
||
Usage examples | ||
============== | ||
|
||
Open a Command Prompt and run: | ||
|
||
# Count the primes below 10^14 | ||
> primecount 1e14 | ||
|
||
# Print progress and status information during computation | ||
> primecount 1e20 --status | ||
|
||
# Count primes using Meissel's algorithm | ||
> primecount 2**32 --meissel | ||
|
||
# Find the 10^14th prime using 4 threads | ||
> primecount 1e14 --nthprime --threads=4 --time | ||
|
||
Command-line options | ||
==================== | ||
|
||
Usage: primecount x [OPTION]... | ||
Count the primes below x <= 10^31 using fast implementations of the | ||
combinatorial prime counting function. | ||
|
||
Options: | ||
|
||
-d, --deleglise_rivat Count primes using Deleglise-Rivat algorithm | ||
--legendre Count primes using Legendre's formula | ||
--lehmer Count primes using Lehmer's formula | ||
-l, --lmo Count primes using Lagarias-Miller-Odlyzko | ||
-m, --meissel Count primes using Meissel's formula | ||
--Li Approximate pi(x) using the logarithmic integral | ||
--Li_inverse Approximate the nth prime using Li^-1(x) | ||
-n, --nthprime Calculate the nth prime | ||
-p, --primesieve Count primes using the sieve of Eratosthenes | ||
--phi=<a> phi(x, a) counts the numbers <= x that are | ||
not divisible by any of the first a primes | ||
--Ri Approximate pi(x) using Riemann R | ||
--Ri_inverse Approximate the nth prime using Ri^-1(x) | ||
-s[N], --status[=N] Show computation progress 1%, 2%, 3%, ... | ||
[N] digits after decimal point e.g. N=1, 99.9% | ||
--test Run various correctness tests and exit | ||
--time Print the time elapsed in seconds | ||
-t<N>, --threads=<N> Set the number of threads, 1 <= N <= CPU cores | ||
-v, --version Print version and license information | ||
-h, --help Print this help menu | ||
|
||
Advanced Deleglise-Rivat options: | ||
|
||
-a<N>, --alpha=<N> Tuning factor, 1 <= alpha <= x^(1/6) | ||
--P2 Only compute the 2nd partial sieve function | ||
--S1 Only compute the ordinary leaves | ||
--S2_trivial Only compute the trivial special leaves | ||
--S2_easy Only compute the easy special leaves | ||
--S2_hard Only compute the hard special leaves |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
primeCountBinary = FileNameJoin[{DirectoryName[$InputFileName], "Binaries", $SystemID, "primecount"}] ]; | ||
|
||
PrimeCount[n_Integer] := ToExpression[ StringTrim[ RunProcess[ {primeCountBinary, ToString[n]}, "StandardOutput"]]]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters