This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A070672 #13 Nov 20 2024 15:38:44 %S A070672 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7,1,1,1,1,1, %T A070672 1,1,1,1,1,1,1,1,4,1,1,1,1,1,8,1,1,1,1,1,1,1,1,7,1,1,1,1,1,1,1,1,1,1, %U A070672 1,1,20,1,1,1,1,1,1,1,1,1,1,1,1,1,1,11,7,1,1,1,1,1 %N A070672 Smallest m in range 2..n-1 such that m^7 == 1 mod n, or 1 if no such number exists. %H A070672 Alois P. Heinz, <a href="/A070672/b070672.txt">Table of n, a(n) for n = 1..10000</a> %p A070672 a:= proc(n) local m; %p A070672 for m from 2 to n-1 do %p A070672 if m &^ 7 mod n = 1 then return m fi %p A070672 od; 1 %p A070672 end: %p A070672 seq(a(n), n=1..100); # _Alois P. Heinz_, Jun 29 2014 %t A070672 a[n_] := Module[{m}, For[m = 2, m <= n-1, m++, If[PowerMod[m, 7, n] == 1, Return[m]]]; 1]; %t A070672 Table[a[n], {n, 1, 100}] (* _Jean-François Alcover_, Nov 20 2024 *) %o A070672 (PARI) a(n) = {for (m=2, n-1, if (lift(Mod(m, n)^7) == 1, return (m));); return (1);} \\ _Michel Marcus_, Jun 29 2014 %Y A070672 Cf. A070667. %K A070672 nonn %O A070672 1,29 %A A070672 _N. J. A. Sloane_, May 08 2002