OFFSET
4,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 4..20000
FORMULA
MATHEMATICA
Table[SelectFirst[Range[2, Sqrt@ n], PowerMod[#, n , n] == Mod[#, n] &] /. k_ /; MissingQ@ k -> 0, {n, 4, 90}] (* Michael De Vlieger, Aug 09 2017 *)
PROG
(Magma) lst:=[]; for n in [4..90] do r:=Floor(Sqrt(n)); for k in [2..r] do if Modexp(k, n, n) eq k then Append(~lst, k); break; end if; if k eq r then Append(~lst, 0); end if; end for; end for; lst;
(PARI) a(n) = for (k=2, sqrtint(n), if (Mod(k, n)^n == k, return(k)); ); return (0); \\ Michel Marcus, Aug 19 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Arkadiusz Wesolowski, Aug 05 2017
STATUS
approved