OFFSET
0,6
COMMENTS
a(n) is minimum e for which 3^e = +/-1 mod n, or zero if no e exists.
REFERENCES
H. Cohen, Course in Computational Algebraic Number Theory, Springer, 1993, p. 25, Algorithm 1.4.3
LINKS
Eric Weisstein's World of Mathematics, Multiplicative Order.
Eric Weisstein's World of Mathematics, Suborder Function
S. Wolfram, Algebraic Properties of Cellular Automata (1984), Appendix B.
MATHEMATICA
Suborder[k_, n_] := If[n > 1 && GCD[k, n] == 1, Min[MultiplicativeOrder[k, n, {-1, 1}]], 0];
a[n_] := Suborder[3, n];
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Harry J. Smith, Feb 08 2005
STATUS
approved