OFFSET
0,8
COMMENTS
a(n) is minimum e for which 5^e = +/-1 mod n, or zero if no e exists.
For n > 2, a(n) <= (n-1)/2, with equality if (but not only if) n is in A019335. - Robert Israel, Mar 20 2020
REFERENCES
H. Cohen, Course in Computational Algebraic Number Theory, Springer, 1993, p. 25, Algorithm 1.4.3
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
Eric Weisstein's World of Mathematics, Multiplicative Order.
S. Wolfram, Algebraic Properties of Cellular Automata (1984), Appendix B.
Eric Weisstein's World of Mathematics, Suborder Function
MAPLE
f:= proc(n) local x;
if n mod 5 = 0 then return 0 fi;
x:= numtheory:-mlog(-1, 5, n);
if x <> FAIL then x else numtheory:-order(5, n) fi
end proc:
f(1):= 0:
map(f, [$0..100]); # Robert Israel, Mar 20 2020
MATHEMATICA
Suborder[k_, n_] := If[n > 1 && GCD[k, n] == 1, Min[MultiplicativeOrder[k, n, {-1, 1}]], 0];
a[n_] := Suborder[5, n];
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Harry J. Smith, Feb 08 2005
STATUS
approved