Changes for version 0.61 - 2017-03-12
- ADDED
- is_semiprime(n) Returns 1 if n has exactly 2 prime factors
- is_pillai(p) Returns 0 or v wherev v! % n == n-1 and n % v != 1
- inverse_li(n) Integer inverse of Logarithmic Integral
- FUNCTIONALITY AND PERFORMANCE
- is_power(-1,k) now returns true for odd k.
- RiemannZeta with GMP was not subtracting 1 from results > 9.
- PP Bernoulli algorithm changed to Seidel from Brent-Harvey. 2x speedup. Math::BigNum is 10x faster, and our GMP code is 2000x faster.
- LambertW changes in C and PP. Much better initial approximation, and switch iteration from Halley to Fritsch. 2 to 10x faster.
- Try to use GMP LambertW for bignums if it is available.
- Use Montgomery math in more places:
- sqrtmod. 1.2-1.7x faster.
- is_primitive_root. Up to 2x faster for some inputs.
- p-1 factoring stage 1.
- Tune AKS r/s selection above 32-bit.
- primes.pl uses twin_primes function for ~3x speedup.
- native chinese can handle some cases that used to overflow. Use Shell sort on moduli to prevent pathological-but-reasonable test case.
- chinese directly to GMP
- Switch to Bytes::Random::Secure::Tiny -- fewer dependencies.
- PP nth_prime_approx has better MSE and uses inverse_li above 10^12.
- All random prime functions will use GMP versions if possible and if a custom irand has not been configured. They are much faster than the PP versions at smaller bit sizes.
- is_carmichael and is_pillai small speedups.
Modules
Utilities related to prime numbers, including fast sieves and factoring
Elliptic curve operations for affine points
Elliptic curve operations for projective points
An auto-free object for Math::Prime::Util
Pure Perl version of Math::Prime::Util
PP front end for Math::Prime::Util
Primality proofs and certificates
A tied array for primes
An object iterator for primes
Generate random primes
Generate random primes using MPU::GMP
Perl Big Float versions of Riemann Zeta and R functions
Number theory utilities
Examples
- examples/README
- examples/abundant.pl
- examples/csrand-gmp.pl
- examples/csrand.pl
- examples/fibprime-mce.pl
- examples/fibprime-serial.pl
- examples/fibprime-threads.pl
- examples/find_mr_bases.pl
- examples/inverse_totient.pl
- examples/ktuplet-threads.pl
- examples/ktuplet.pl
- examples/numseqs.pl
- examples/porter.pl
- examples/project_euler_010.pl
- examples/project_euler_021.pl
- examples/project_euler_037.pl
- examples/project_euler_047.pl
- examples/project_euler_049.pl
- examples/project_euler_069.pl
- examples/project_euler_070.pl
- examples/project_euler_072.pl
- examples/project_euler_095.pl
- examples/project_euler_131.pl
- examples/project_euler_142.pl
- examples/project_euler_193.pl
- examples/project_euler_211.pl
- examples/project_euler_214.pl
- examples/project_euler_342.pl
- examples/project_euler_357.pl
- examples/sophie_germain.pl
- examples/twin_primes.pl
- examples/verify-cert.pl
- examples/verify-gmp-ecpp-cert.pl
- examples/verify-primegaps.pl
- examples/verify-sage-ecpp-cert.pl