Skip to content

Commit

Permalink
Comment the znorder(a,n)==totient(n) method but don't use it.
Browse files Browse the repository at this point in the history
  • Loading branch information
danaj committed Jun 11, 2024
1 parent 1474e2a commit f998bd8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Math/Prime/Util/PP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7258,6 +7258,8 @@ sub is_primitive_root {
return Math::Prime::Util::GMP::is_primitive_root($a,$n)
if $Math::Prime::Util::_GMPfunc{"is_primitive_root"};
# my $order = Mznorder($a,$n); return 0 unless defined $order; return 0+($order == Mtotient($n));
if (Mis_even($n)) {
return 0 if ($n % 4) == 0; # n can't still be even after we shift it
return 0 if Mis_even($a); # n and a cannot both be even
Expand All @@ -7276,8 +7278,6 @@ sub is_primitive_root {
return 0 if Mkronecker($a,$n) != -1;
return 0 if ($phi % 3) == 0 && Mpowmod($a,Mdivint($phi,3),$n) == 1;
return 0 if ($phi % 5) == 0 && Mpowmod($a,Mdivint($phi,5),$n) == 1;
my $order = Mznorder($a,$n); return 0 unless defined $order; return 0+($order == Mtotient($n));
foreach my $f (Mfactor_exp($phi)) {
my $fp = $f->[0];
return 0 if $fp > 5 && Mpowmod($a, Mdivint($phi,$fp), $n) == 1;
Expand Down

0 comments on commit f998bd8

Please sign in to comment.