OFFSET
1,3
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..16384
Antti Karttunen, Data supplement: n, a(n) computed for n = 1..65537
EXAMPLE
a(7) = 2 because k^7 == 0, 1, 2, 3, 4, 5, 6 (mod 7) => 2 is the smallest prime.
MAPLE
for n from 1 to 100 do: W:={}:for k from 0 to n-1 do:z:= irem(k^n, n): if type(z, prime)=true then W:=W union {z}:else fi:od: x:=nops(W): if x<>0 then printf(`%d, `, W[1]): else printf(`%d, `, 0):fi: od:
MATHEMATICA
Table[SelectFirst[Sort[PowerMod[Range[n-1], n, n]], PrimeQ], {n, 90}]/.Missing["NotFound"]->0 (* Harvey P. Dale, May 01 2023 *)
PROG
(PARI) A202036(n) = { my(z, y=n); for(x=1, n-1, z = lift(Mod(x, n)^n); if(isprime(z), y = min(z, y))); if(y==n, 0, y); }; \\ - Antti Karttunen, May 19 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Dec 09 2011
STATUS
approved