%I #10 Sep 08 2022 08:45:06
%S 0,1,0,2,4,0,6,2,0,4,5,0,3,6,0,4,16,0,18,4,0,5,11,0,20,3,0,6,28,0,30,
%T 8,0,16,12,0,18,18,0,4,8,0,42,10,0,11,23,0,42,20,0,6,52,0,20,6,0,28,
%U 29,0,10,30,0,16,12,0,22,16,0,12,35,0,12,18,0,18,30,0
%N Smallest m in range 1..phi(n) such that 3^m == 1 mod n, or 0 if no such number exists.
%t Table[SelectFirst[Range[EulerPhi[n]],PowerMod[3,# ,n]==1&,0],{n,80}] (* The program uses the SelectFirst function from Mathematica version 10 *) (* _Harvey P. Dale_, Aug 18 2015 *)
%o (Magma) [0] cat [Modorder(3, n): n in [2..100]]; // _Vincenzo Librandi_, Apr 01 2014
%Y Cf. A070667-A070675, A002326, A053447, A070677, A070681, A070678, A053451, A070679, A070682, A070680, A070683.
%K nonn
%O 1,4
%A _N. J. A. Sloane_ and _Amarnath Murthy_, May 08 2002