OFFSET
1,3
COMMENTS
This sequence gives the period length of the base-p representation of HarmonicNumber[p-1]/p^2 (whose numerator is A061002).
EXAMPLE
a(5) = 6 because 2^6 = 1 mod 9, 3^6 = 1 mod 8, 4^6 = 1 mod 7, 5^6 = 1 mod 6, 6^6 = 1 mod 5, 7^6 = 1 mod 4, 8^6 = 1 mod 3, 9^6 = 1 mod 2 and 6 is the minimal exponent that satisfies this.
MATHEMATICA
a[p_?PrimeQ] := Module[{e = 1}, While[! And @@ Table[Mod[PowerMod[i, e, p - i] - 1, p - i] == 0, {i, p - 1}], e++]; e]; a /@ Prime[Range[10]]
CROSSREFS
KEYWORD
nonn
AUTHOR
Michael Ulm (taga(AT)hades.math.uni-rostock.de), Dec 18 2001
STATUS
approved