Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #12 Mar 06 2024 09:02:54
%S 1,1,2,3,2,5,6,3,8,3,10,5,5,13,2,3,2,17,18,3,8,21,22,5,7,5,26,13,12,7,
%T 30,3,10,9,6,17,6,37,5,3,3,13,42,21,8,45,46,5,48,7,2,5,23,53,12,13,20,
%U 17,58,7,11,61,8,7,8,23,66,9,22,13,70,17,10,31,7,37
%N Smallest m in range 2..n-1 such that m^8 == 1 mod n, or 1 if no such number exists.
%H Alois P. Heinz, <a href="/A070673/b070673.txt">Table of n, a(n) for n = 1..10000</a>
%p a:= proc(n) local m;
%p for m from 2 to n-1 do
%p if m &^ 8 mod n = 1 then return m fi
%p od; 1
%p end:
%p seq(a(n), n=1..100); # _Alois P. Heinz_, Jun 29 2014
%t a[n_] := Module[{m}, For[m = 2, m <= n-1, m++,
%t If[PowerMod[m, 8, n] == 1, Return[m]]]; 1];
%t Table[a[n], {n, 1, 100}] (* _Jean-François Alcover_, Mar 06 2024 *)
%o (PARI) a(n) = {for (m=2, n-1, if (lift(Mod(m, n)^8) == 1, return (m));); return (1);} \\ _Michel Marcus_, Jun 29 2014
%Y Cf. A070667.
%K nonn
%O 1,3
%A _N. J. A. Sloane_, May 08 2002