michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: =head1 NAME michael@0: michael@0: lap - compute least annihilating power of a number michael@0: michael@0: =head1 SYNOPSIS michael@0: michael@0: lap michael@0: michael@0: =head1 DESCRIPTION michael@0: michael@0: The B program computes the order of I modulo I, for michael@0: arbitrary precision integers I and I. The B of I michael@0: modulo I is defined as the smallest positive value I for which michael@0: I raised to the Ith power, modulo I, is equal to 1. The michael@0: order may not exist, if I is composite. michael@0: michael@0: =head1 RESTRICTIONS michael@0: michael@0: This program is very slow, especially for large moduli. It is michael@0: intended as a way to help find primitive elements in a modular field, michael@0: but it does not do so in a particularly inefficient manner. It was michael@0: written simply to help verify that a particular candidate does not michael@0: have an obviously short cycle mod I. michael@0: michael@0: =head1 SEE ALSO michael@0: michael@0: gcd(1), invmod(1), isprime(1) michael@0: michael@0: =head1 AUTHOR michael@0: michael@0: Michael J. Fromberger michael@0: Thayer School of Engineering, Hanover, New Hampshire, USA