OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
a(n)=Min{x=odd number; Mod[ -1+n^(x-1), x]=0}
MATHEMATICA
a[n_] := Module[{k = 1}, While[GCD[n, k] > 1 || PrimeQ[k] || PowerMod[n, k - 1, k] != 1, k += 2]; k]; Array[a, 100] (* Amiram Eldar, Nov 11 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Nov 25 2003
STATUS
approved