OFFSET
1,1
COMMENTS
a(n-1) = n for n = {2,3,5,7,9,11,13,15,17,19,21,23,25,27,29,...} = 2 together with odd numbers n > 1.
a(n) coincides with A082048(n) up to n = 24.
a(n) is the smallest number k > n such that n^k == n (mod k). Conjecture: a(n) is the smallest number k > n such that n^(k-1) == 1 (mod k). Thus a(n) is coprime to n. - Thomas Ordowski, Aug 03 2018
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..996
MATHEMATICA
Table[Min[Select[Range[101], PowerMod[n, #, # ]==n&]], {n, 1, 100}]
lkgn[n_]:=Module[{k=1}, While[PowerMod[n, k, k]!=n, k++]; k]; Array[lkgn, 80] (* Harvey P. Dale, May 25 2021 *)
CROSSREFS
Cf. A128149 = Least k such that n^k (mod k) = n-1. Cf. A128172 = Least k such that n^k (mod k) = n+1. Cf. A036236, A078457, A119678, A119679, A127816, A119715, A119714, A127817, A127818, A127819, A127820, A127821, A128154, A128155, A128156, A128157, A128158, A128159, A128160. Cf. A082048 = least number greater than n having greater smallest prime factor than that of n.
KEYWORD
nonn
AUTHOR
Alexander Adamchuk, Feb 17 2007
EXTENSIONS
Name clarified by Thomas Ordowski, Aug 03 2018
STATUS
approved