login
Smallest m in range 1..phi(n) such that 7^m == 1 mod n, or 0 if no such number exists.
10

%I #12 Sep 08 2022 08:45:06

%S 0,1,1,2,4,1,0,2,3,4,10,2,12,0,4,2,16,3,3,4,0,10,22,2,4,12,9,0,7,4,15,

%T 4,10,16,0,6,9,3,12,4,40,0,6,10,12,22,23,2,0,4,16,12,26,9,20,0,3,7,29,

%U 4,60,15,0,8,12,10,66,16,22,0,70,6,24,9,4,6,0,12

%N Smallest m in range 1..phi(n) such that 7^m == 1 mod n, or 0 if no such number exists.

%H Harvey P. Dale, <a href="/A070678/b070678.txt">Table of n, a(n) for n = 1..1000</a>

%t Table[SelectFirst[Range[EulerPhi[n]],PowerMod[7,#,n]==1&],{n,80}]/.(Missing["NotFound"]->0) (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Jan 25 2019 *)

%o (Magma) [0] cat [Modorder(7, n): n in [2..100]]; // _Vincenzo Librandi_, Apr 01 2014

%Y Cf. A070667-A070675, A002326, A070676, A053447, A070677, A070681, A053451, A070679, A070682, A070680, A070683.

%K nonn

%O 1,4

%A _N. J. A. Sloane_ and _Amarnath Murthy_, May 08 2002