OFFSET
0,2
COMMENTS
a(A001597(n)) = 0 for n > 1.
LINKS
G. L. Honaker, Jr. and Chris Caldwell, Prime Curios! 313
Eric Weisstein's World of Mathematics, Primitive Root
Robert G. Wilson v, Table of n, a(n) for n = 0..205 (contains -1 where a term has not yet been found)
EXAMPLE
a(7) = 22, since 22 has 7 as smallest positive primitive root and no number < 22 has 7 as smallest positive primitive root.
MATHEMATICA
lst2 = {}; r = 47; smallestPrimitiveRoot[n_ /; n <= 1] = 0; smallestPrimitiveRoot[n_] := Block[{pr = PrimitiveRoot[n], g}, If[! NumericQ[pr], g = 0, g = 1; While[g <= pr, If[CoprimeQ[g, n] && MultiplicativeOrder[g, n] == EulerPhi[n], Break[]]; g++]]; g]; lst1 = Union[Flatten@Table[n^i, {i, 2, Log[2, r]}, {n, 2, r^(1/i)}]]; Do[n = 2; If[MemberQ[lst1, l], AppendTo[lst2, 0], While[True, If[smallestPrimitiveRoot[n] == l, AppendTo[lst2, n]; Break[]]; n++]], {l, r}]; Prepend[lst2, 1] (* Most of the code is from Jean-François Alcover *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Arkadiusz Wesolowski, Jul 05 2012
STATUS
approved