login
A001390
Smallest multiplicative generator for quadratic residues mod prime(n).
2
1, 1, 4, 2, 3, 4, 2, 4, 2, 4, 7, 3, 2, 9, 2, 4, 3, 4, 4, 2, 6, 2, 3, 5, 2, 4, 2, 3, 12, 9, 9, 3, 2, 4, 4, 5, 3, 4, 2, 4, 3, 4, 2, 2, 4, 2, 4, 9, 3, 5, 7, 2, 3, 3, 9, 2, 4, 2, 7, 5, 6, 4, 7, 2, 2, 4, 5, 3, 3, 3, 9, 2, 2, 3, 4, 2, 4, 3, 2, 2, 3, 4, 5, 6, 5, 3, 2, 3, 4, 2, 3, 2, 2, 4, 5, 2, 4, 2, 4, 4, 4, 4, 3, 2, 5, 17
OFFSET
1,3
LINKS
MAPLE
f:= proc(p) local x;
for x from 1 do if numtheory:-order(x, p) = (p-1)/2 then return x fi od
end proc:
f(2):= 1:
seq(f(ithprime(n)), n=1..1000); # Robert Israel, Jan 14 2016
MATHEMATICA
f[p_] := Module[{x}, For[x = 1, True, x++, If[MultiplicativeOrder[x, p] == (p - 1)/2, Return[x]]]];
f[2] = 1;
f /@ Prime[Range[100]] (* Jean-François Alcover, Jul 17 2020, after Maple *)
CROSSREFS
Cf. A000040.
Sequence in context: A183993 A184403 A198120 * A180343 A332273 A225001
KEYWORD
nonn
EXTENSIONS
More terms from David W. Wilson, Aug 15 1996
Offset changed by Robert Israel, Jan 14 2016
STATUS
approved