[libmath-prime-util-perl] 101/181: nth_prime for legendre phi, not next_prime
Partha P. Mukherjee
ppm-guest at moszumanska.debian.org
Thu May 21 18:51:11 UTC 2015
This is an automated email from the git hooks/post-receive script.
ppm-guest pushed a commit to annotated tag v0.36
in repository libmath-prime-util-perl.
commit 8a8f04f1ad3d59253c2912248fba08e655e9591d
Author: Dana Jacobsen <dana at acm.org>
Date: Thu Jan 2 02:37:58 2014 -0800
nth_prime for legendre phi, not next_prime
---
lib/Math/Prime/Util/PP.pm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/Math/Prime/Util/PP.pm b/lib/Math/Prime/Util/PP.pm
index c8e61ee..68b85c4 100644
--- a/lib/Math/Prime/Util/PP.pm
+++ b/lib/Math/Prime/Util/PP.pm
@@ -636,7 +636,8 @@ sub _mapes {
sub _legendre_phi {
my ($x, $a, $primes) = @_;
return _mapes($x,$a) if $a <= 6;
- $primes = primes(next_prime($a)) unless defined $primes;
+ $primes = primes(Math::Prime::Util::nth_prime_upper($a+1)) unless defined $primes;
+print "a: $a ", join(",",@$primes), "\n";
return ($x > 0 ? 1 : 0) if $x < $primes->[$a];
my $sum = 0;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmath-prime-util-perl.git
More information about the Pkg-perl-cvs-commits
mailing list