A174621 a(n) is the smallest generator for the group of numbers relatively prime to n under multiplication mod n; a(n) = -1 if n is not a power of a prime or twice a power of a prime.
1, 2, 3, 2, 5, 3, -1, 2, 3, 2, -1, 2, 3, -1, -1, 3, 5, 2, -1, -1, 7, 5, -1, 2, 7, 2, -1, 2, -1, 3, -1, -1, 3, -1, -1, 2, 3, -1, -1, 6, -1, 3, -1, -1, 5, 5, -1, 3, 3, -1, -1, 2, 5, -1, -1, -1, 3, 2, -1, 2, 3, -1, -1, -1, -1, 2, -1, -1, -1, 7, -1, 5, 5, -1, -1, -1, -1, 3, -1, 2, 7, 2, -1, -1, 3, -1, -1, 3, -1, -1, -1, -1, 5, -1, -1, 5, 3, -1, -1
Offset: 2
Crossrefs
Cf. A046145.
Programs
-
Maple
subs(FAIL=-1, [seq(numtheory:-primroot(n), n=2..1000)]); # Robert Israel, Jan 11 2015
-
Mathematica
lst = {}; f[n_] := PrimitiveRoot[n]; Do[If[IntegerQ@f[n], g = f[n], g = -1]; AppendTo[lst, g], {n, 2, 73}]; Prepend[lst, -1]
Extensions
Name changed by Arkadiusz Wesolowski, Jul 19 2012
Offset changed and ambiguous term a(0) removed by Arkadiusz Wesolowski, Jul 20 2012
a(1) removed by Joerg Arndt, Jan 11 2015
Comments