OFFSET
1,7
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
MAPLE
a:= proc(n) local m;
for m from 2 to n-1 do
if m &^ 9 mod n = 1 then return m fi
od; 1
end:
seq(a(n), n=1..100); # Alois P. Heinz, Jun 29 2014
MATHEMATICA
a[n_] := Module[{m}, For[m = 2, m <= n-1, m++, If[PowerMod[m, 9, n] == 1, Return[m]]]; 1];
Array[a, 100] (* Jean-François Alcover, Nov 18 2020 *)
PROG
(PARI) a(n) = {for (m=2, n-1, if (lift(Mod(m, n)^9) == 1, return (m)); ); return (1); } \\ Michel Marcus, Jun 29 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, May 08 2002
STATUS
approved