%I #19 Feb 16 2025 08:32:56
%S 0,0,1,0,1,2,0,3,2,0,2,5,0,3,3,0,4,8,0,9,4,0,5,11,0,10,3,0,3,14,0,15,
%T 8,0,8,12,0,9,9,0,4,4,0,21,10,0,11,23,0,21,10,0,6,26,0,20,6,0,14,29,0,
%U 5,15,0,16,12,0,11,16,0,12,35,0,6,9,0,9,30,0,39,4,0,4,41,0,16,21,0,10,44
%N Multiplicative suborder of 3 (mod n) = sord(3, n).
%C a(n) is minimum e for which 3^e = +/-1 mod n, or zero if no e exists.
%D H. Cohen, Course in Computational Algebraic Number Theory, Springer, 1993, p. 25, Algorithm 1.4.3
%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/MultiplicativeOrder.html">Multiplicative Order</a>.
%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/SuborderFunction.html">Suborder Function</a>
%H S. Wolfram, <a href="http://www.stephenwolfram.com/publications/articles/ca/84-properties/9/text.html">Algebraic Properties of Cellular Automata (1984)</a>, Appendix B.
%t Suborder[k_, n_] := If[n > 1 && GCD[k, n] == 1, Min[MultiplicativeOrder[k, n, {-1, 1}]], 0];
%t a[n_] := Suborder[3, n];
%t a /@ Range[0, 100] (* _Jean-François Alcover_, Mar 21 2020, after _T. D. Noe_ in A003558 *)
%K easy,nonn,changed
%O 0,6
%A _Harry J. Smith_, Feb 08 2005