PRIMECOUNT(1) | PRIMECOUNT(1) |
primecount - count prime numbers
primecount x [options]
Count the number of primes less than or equal to x (<= 10^31) using fast implementations of the combinatorial prime counting function algorithms. By default primecount counts primes using Xavier Gourdon’s algorithm which has a runtime complexity of O(x^(2/3) / log^2 x) operations and uses O(x^(2/3) * log^3 x) memory. primecount is multi-threaded, it uses all available CPU cores by default.
-d, --deleglise-rivat
-g, --gourdon
-l, --legendre
--lehmer
--lmo
-m, --meissel
--Li
--Li-inverse
-n, --nth-prime
-p, --primesieve
--phi X A
--Ri
--Ri-inverse
-s, --status[=NUM]
--test
--time
-t, --threads=NUM
-v, --version
-h, --help
--P2
--S1
--S2-trivial
--S2-easy
--S2-hard
The alpha tuning factor mainly balances the computation of the S2_easy and S2_hard formulas. By increasing alpha the runtime of the S2_hard formula will usually decrease but the runtime of the S2_easy formula will increase. For large pi(x) computations with x >= 10^25 you can usually achieve a significant speedup by increasing alpha.
The alpha tuning factor is also very useful for verifying pi(x) computations. You compute pi(x) twice but for the second computation you use a slightly different alpha factor. If the results of both pi(x) computations match then pi(x) has been verified successfully.
-a, --alpha=NUM
--AC
--B
--D
--Phi0
--Sigma
The alpha_y and alpha_z tuning factors mainly balance the computation of the A, B, C and D formulas. When alpha_y is decreased but alpha_z is increased then the runtime of the B formula will increase but the runtime of the A, C and D formulas will decrease. For large pi(x) computations with x >= 10^25 you can usually achieve a significant speedup by decreasing alpha_y and increasing alpha_z. For convenience when you increase alpha_z using --alpha-z=NUM then alpha_y is automatically decreased.
Both the alpha_y and alpha_z tuning factors are also very useful for verifying pi(x) computations. You compute pi(x) twice but for the second computation you use a slightly different alpha_y or alpha_z factor. If the results of both pi(x) computations match then pi(x) has been verified successfully.
--alpha-y=NUM
--alpha-z=NUM
primecount 1000
primecount 1e17 --status
primecount 1e15 --threads 1 --time
https://github.com/kimwalisch/primecount
Kim Walisch <kim.walisch@gmail.com>
12/15/2022 |