Jump to content

Multiplicative order: Difference between revisions

Add Perl using modules (we still should have a full implementation, using one of the same modules to supply factoring and lcm)
(Added Maple implementation.)
(Add Perl using modules (we still should have a full implementation, using one of the same modules to supply factoring and lcm))
Line 633:
=={{header|PARI/GP}}==
<lang parigp>znorder(Mod(a,n))</lang>
 
=={{header|Perl}}==
Using modules:
<lang perl>use Math::Prime::Util qw/znorder/;
say znorder(54, 100001);
use bigint; say znorder(11, 1 + 10**100);</lang>
or
<lang perl>use Math::Pari qw/znorder Mod/;
say znorder(Mod(54, 100001));
say znorder(Mod(11, 1 + Math::Pari::PARI(10)**100));</lang>
 
=={{header|Perl 6}}==
<lang perl6>my @primes := 2, grep *.is-prime, (3,5,7...*);
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.